don't check string content when comparing states (IDEA-219169)

states are used as keys only in state loop prevention, it should be enough to check whether they use same string or not

GitOrigin-RevId: 86c19587537e12c77ff5eac55bedce0ba344ec83
This commit is contained in:
Dennis Ushakov
2019-07-29 20:42:53 +03:00
committed by intellij-monorepo-bot
parent 780332cab5
commit 124c3ffe0c
@@ -52,11 +52,16 @@ class TextMateLexerState implements LexerState {
return syntaxRule.equals(state.syntaxRule) &&
matchData.equals(state.matchData) &&
priorityMatch == state.priorityMatch &&
Objects.equals(string, state.string);
stringId() == state.stringId();
}
@Override
public int hashCode() {
return Objects.hash(syntaxRule, matchData, priorityMatch, string);
return Objects.hash(syntaxRule, matchData, priorityMatch, stringId());
}
@Nullable
private Object stringId() {
return string != null ? string.id : null;
}
}