Skip to content

Commit c52498b

Browse files
andimarekclaude
andcommitted
Simplify ResultPath.initString() — inlining is unnecessary with lazy init
Since toStringValue is lazily computed (once per path), the manual inlining of segmentToString() provides no measurable performance benefit. Simplify back to the clean delegation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4011983 commit c52498b

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

‎src/main/java/graphql/execution/ResultPath.java‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,7 @@ private String initString() {
6565
if (parent == null) {
6666
return "";
6767
}
68-
String parentStr = parent.toString();
69-
if (segment instanceof String) {
70-
if (parentStr.isEmpty()) {
71-
return "/" + segment;
72-
}
73-
return parentStr + "/" + segment;
74-
} else {
75-
if (parentStr.isEmpty()) {
76-
return "[" + segment + "]";
77-
}
78-
return parentStr + "[" + segment + "]";
79-
}
68+
return parent.toString() + segmentToString();
8069
}
8170

8271
public int getLevel() {

0 commit comments

Comments
 (0)