Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5930728

Browse files
committed
Kotlin: Speed up the toString consistency query
Using Top.getAQlClass() means we have to evaluate SummarizedCallableExternal's charpred, and hence summaryElement, which is slow.
1 parent 9a62147 commit 5930728

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

java/ql/consistency-queries/toString.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ string topToString(Top t) {
2020
}
2121

2222
string not1ToString() {
23-
exists(Top t | count(topToString(t)) != 1 and result = "Top which doesn't have exactly 1 toString: " + concat(t.getAQlClass(), ", "))
23+
exists(Top t | count(topToString(t)) != 1 and result = "Top which doesn't have exactly 1 toString: " + t.getPrimaryQlClasses())
2424
or
2525
exists(Location l | count(l.toString()) != 1 and result = "Location which doesn't have exactly 1 toString: " + concat(l.getAQlClass(), ", "))
2626
or

0 commit comments

Comments
 (0)