Skip to content

Commit

Permalink
Optimize base-n codecs
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiolimace committed Apr 7, 2024
1 parent b4a1a42 commit 23fd52c
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ public BaseNDecoder(BaseN base) {
}

protected long get(String string, int i) {
final byte value = map.get(string.charAt(i));

final int chr = string.charAt(i);
if (chr > 255) {
throw InvalidUuidException.newInstance(string);
}

final byte value = map.get(chr);
if (value < 0) {
throw InvalidUuidException.newInstance(string);
}
Expand Down

0 comments on commit 23fd52c

Please sign in to comment.