mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
dfa: don't store useless primitive != null facts
This commit is contained in:
+5
@@ -848,6 +848,7 @@ public class DfaMemoryStateImpl implements DfaMemoryState {
|
||||
}
|
||||
else { // Not Equals
|
||||
if (c1Index.equals(c2Index) || areCompatibleConstants(c1Index, c2Index)) return false;
|
||||
if (isNull(dfaLeft) && isPrimitive(dfaRight) || isNull(dfaRight) && isPrimitive(dfaLeft)) return true;
|
||||
makeClassesDistinct(c1Index, c2Index);
|
||||
myCachedDistinctClassPairs = null;
|
||||
myCachedHash = null;
|
||||
@@ -856,6 +857,10 @@ public class DfaMemoryStateImpl implements DfaMemoryState {
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean isPrimitive(DfaValue value) {
|
||||
return value instanceof DfaVariableValue && ((DfaVariableValue)value).getVariableType() instanceof PsiPrimitiveType;
|
||||
}
|
||||
|
||||
private static boolean preserveConstantDistinction(final Object c1, final Object c2) {
|
||||
return c1 == null && c2 instanceof PsiEnumConstant ||
|
||||
c2 == null && c1 instanceof PsiEnumConstant;
|
||||
|
||||
Reference in New Issue
Block a user