Skip to content

Commit

Permalink
fix wrong condition
Browse files Browse the repository at this point in the history
  • Loading branch information
grandsilence committed Nov 13, 2018
1 parent 12a5aa3 commit bbe6335
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Leaf.Core/Text/StringGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");

// частная оптимизация
Expand Down

0 comments on commit bbe6335

Please sign in to comment.