Skip to content

Commit

Permalink
More small fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
0x3333 committed Oct 24, 2023
1 parent e5bccce commit 7c67b71
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/org/sqids/Sqids.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public class Sqids {
private final Set<String> blockList;

private Sqids(final Builder builder) {
String alphabet = builder.alphabet;
int alphabetLength = alphabet.length();
int minLength = builder.minLength;
Set<String> blockList = new HashSet<>(builder.blockList);
final String alphabet = builder.alphabet;
final int alphabetLength = alphabet.length();
final int minLength = builder.minLength;
final Set<String> blockList = new HashSet<>(builder.blockList);

if (alphabet.getBytes().length != alphabetLength) {
throw new IllegalArgumentException("Alphabet cannot contain multibyte characters");
Expand All @@ -48,8 +48,8 @@ private Sqids(final Builder builder) {
throw new IllegalArgumentException("Minimum length has to be between 0 and " + MIN_LENGTH_LIMIT);
}

Set<String> filteredBlockList = new HashSet<>();
List<String> alphabetChars = new ArrayList<>(Arrays.asList(alphabet.toLowerCase().split("")));
final Set<String> filteredBlockList = new HashSet<>();
final List<String> alphabetChars = new ArrayList<>(Arrays.asList(alphabet.toLowerCase().split("")));
for (String word : blockList) {
if (word.length() >= MIN_BLOCK_LIST_WORD_LENGTH) {
word = word.toLowerCase();
Expand Down

0 comments on commit 7c67b71

Please sign in to comment.