Skip to content

Commit

Permalink
[performance] less calls to isInModuleDeclaration() #1747
Browse files Browse the repository at this point in the history
Reorder costly conditions

#1747
  • Loading branch information
EcljpseB0T authored and jukzi committed Jan 10, 2024
1 parent 0a573e1 commit 6170f1e
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -4902,8 +4902,9 @@ private VanguardScanner getNewVanguardScanner() {
return vs;
}
protected final boolean mayBeAtCasePattern(int token) {
return (!isInModuleDeclaration() && JavaFeature.PATTERN_MATCHING_IN_SWITCH.isSupported(this.complianceLevel, this.previewEnabled))
&& (token == TokenNamecase || this.multiCaseLabelComma);
return ((token == TokenNamecase || this.multiCaseLabelComma)
&& JavaFeature.PATTERN_MATCHING_IN_SWITCH.isSupported(this.complianceLevel, this.previewEnabled))
&& !isInModuleDeclaration();
}
protected final boolean maybeAtLambdaOrCast() { // Could the '(' we saw just now herald a lambda parameter list or a cast expression ? (the possible locations for both are identical.)

Expand Down

0 comments on commit 6170f1e

Please sign in to comment.