Skip to content

Commit 55c6e56

Browse files
committed
Swift: PrintAst.qll nodes() ordering fix not needed
No-double-parents should be sufficient for a stable top-level ordering.
1 parent 8b0da01 commit 55c6e56

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

swift/ql/lib/codeql/swift/printast/PrintAst.qll

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,13 @@ import PrintAstNode
77
cached
88
private int getOrder(PrintAstNode node) {
99
node =
10-
rank[result](PrintAstNode n, Location loc, int index, string accessor |
11-
loc = n.getLocation() and
12-
if any(PrintAstNode p).hasChild(n, index, accessor)
13-
then any()
14-
else (
15-
index = -1 and
16-
accessor = ""
17-
)
10+
rank[result](PrintAstNode n, Location loc |
11+
loc = n.getLocation()
1812
|
1913
n
2014
order by
2115
loc.getFile().getName(), loc.getStartLine(), loc.getStartColumn(), loc.getEndLine(),
22-
loc.getEndColumn(), index, accessor
16+
loc.getEndColumn()
2317
)
2418
}
2519

0 commit comments

Comments
 (0)