Skip to content

Commit e4f6c13

Browse files
committed
faster check for reserved property names
1 parent b215a73 commit e4f6c13

File tree

1 file changed

+9
-1
lines changed
  • visualizer/IdealGraphVisualizer/Data/src/main/java/jdk/graal/compiler/graphio/parsing

1 file changed

+9
-1
lines changed

visualizer/IdealGraphVisualizer/Data/src/main/java/jdk/graal/compiler/graphio/parsing/ModelBuilder.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,14 @@ public void endNode(int nodeId) {
660660
PROPNAME_ID,
661661
PROPNAME_IDX, PROPNAME_BLOCK)));
662662

663+
private static boolean isSystemProperty(String key) {
664+
return switch (key) {
665+
case PROPNAME_HAS_PREDECESSOR, PROPNAME_NAME, PROPNAME_CLASS, PROPNAME_ID, PROPNAME_IDX, PROPNAME_BLOCK ->
666+
true;
667+
default -> false;
668+
};
669+
}
670+
663671
@Override
664672
public void setGroupName(String name, String shortName) {
665673
assert folder instanceof Group;
@@ -761,7 +769,7 @@ public void setNodeProperty(String key, Object value) {
761769
assert currentNode != null;
762770
String k = key;
763771
if (!(value instanceof InputGraph)) {
764-
if (SYSTEM_PROPERTIES.contains(key)) {
772+
if (isSystemProperty(key)) {
765773
k = NOT_DATA + k;
766774
}
767775
setProperty(k, value);

0 commit comments

Comments
 (0)