Skip to content

Commit

Permalink
Populate allChars buffer once.
Browse files Browse the repository at this point in the history
  • Loading branch information
dfish3r committed Oct 13, 2024
1 parent 1c49a50 commit 3541089
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/org/passay/PasswordGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ public String generatePassword(final int length, final List<? extends Rule> rule
characterRule.getValidCharacters(),
Math.min(length, characterRule.getNumberOfCharacters()),
buffer);
allChars.append(characterRule.getValidCharacters());
if (count == 0) {
allChars.append(characterRule.getValidCharacters());
}
}
}
}
Expand Down

0 comments on commit 3541089

Please sign in to comment.