Skip to content

Commit

Permalink
remove redundant check
Browse files Browse the repository at this point in the history
  • Loading branch information
nilswende committed Nov 5, 2024
1 parent c816d4f commit cda435b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/com/wn/dbml/compiler/lexer/LexerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,9 @@ private Token nextColorCode() {
.takeWhile(Char::isHexDigit)
.collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append)
.toString();
if ((color.length() == 6 || color.length() == 3) && color.chars().allMatch(Char::isHexDigit)) {
skipChars(color.length());
var length = color.length();
if (length == 6 || length == 3) {
skipChars(length);
return new TokenImpl(TokenType.COLOR_CODE, color);
}
return new TokenImpl(TokenType.ILLEGAL, color);
Expand Down

0 comments on commit cda435b

Please sign in to comment.