From bbe6335937b97b96866a9c03846edf41eb55c4f6 Mon Sep 17 00:00:00 2001 From: grandsilence Date: Wed, 14 Nov 2018 01:49:26 +0300 Subject: [PATCH] fix wrong condition --- Leaf.Core/Text/StringGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Leaf.Core/Text/StringGenerator.cs b/Leaf.Core/Text/StringGenerator.cs index df410e2..abab9bf 100644 --- a/Leaf.Core/Text/StringGenerator.cs +++ b/Leaf.Core/Text/StringGenerator.cs @@ -96,7 +96,7 @@ public static string RandomPassword(int minDigits, int maxDigits) private static void AppendRandomNumbers(this StringBuilder sb, int minDigits, int maxDigits) { // проверка параметров - if (minDigits > maxDigits || maxDigits < minDigits) // || minDigits == 0 || maxDigits == 0 + if (maxDigits - minDigits < 0) throw new ArgumentException("Неверно задано количество цифр для добавления в StringBuilder"); // частная оптимизация