mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
precompute hashcode (IDEA-225101)
GitOrigin-RevId: 74d93b49bbfebab7eb375481d12062bad545ed9e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
aeb7990cc0
commit
80f9ad7923
+3
-1
@@ -11,6 +11,7 @@ import org.jetbrains.plugins.textmate.regex.StringWithId;
|
||||
import java.util.Objects;
|
||||
|
||||
class TextMateLexerState implements LexerState {
|
||||
private final int hashcode;
|
||||
@NotNull public final SyntaxNodeDescriptor syntaxRule;
|
||||
@NotNull public final MatchData matchData;
|
||||
@NotNull public final TextMateWeigh.Priority priorityMatch;
|
||||
@@ -24,6 +25,7 @@ class TextMateLexerState implements LexerState {
|
||||
this.matchData = matchData;
|
||||
this.priorityMatch = priority;
|
||||
string = matchData.matched() ? line : null;
|
||||
hashcode = Objects.hash(syntaxRule, matchData, priorityMatch, stringId());
|
||||
}
|
||||
|
||||
public static TextMateLexerState notMatched(@NotNull SyntaxNodeDescriptor syntaxRule) {
|
||||
@@ -57,7 +59,7 @@ class TextMateLexerState implements LexerState {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(syntaxRule, matchData, priorityMatch, stringId());
|
||||
return hashcode;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
Reference in New Issue
Block a user