Skip to content

Commit 7163b54

Browse files
committed
Avoid unnecessary lookup to builtin variables
1 parent d5ab75f commit 7163b54

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

jme3-glsl-highlighter/src/com/jme3/gde/glsl/highlighter/lexer/GlslKeywordLibrary.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,9 @@ public enum KeywordType {
491491
public static KeywordType lookup(String s) {
492492
KeywordType returnType = null;
493493
returnType = lookup(s, returnType, KeywordType.BASIC_TYPE, basicTypesTrie);
494-
returnType = lookup(s, returnType, KeywordType.BUILTIN_VARIABLE, builtinVariablesTrie);
494+
if (returnType == KeywordType.UNFINISHED || returnType == null) {
495+
returnType = lookup(s, returnType, KeywordType.BUILTIN_VARIABLE, builtinVariablesTrie);
496+
}
495497
if (returnType == KeywordType.UNFINISHED || returnType == null) {
496498
returnType = lookup(s, returnType, KeywordType.BUILTIN_FUNCTION, builtinFunctionsTrie);
497499
}

0 commit comments

Comments
 (0)