Skip to content

Commit cfdc0d1

Browse files
committed
A7-1-7: Address performance issue on 2.20.7
Poor join ordering on locations.
1 parent 84a0ed5 commit cfdc0d1

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

cpp/autosar/src/rules/A7-1-7/IdentifierDeclarationAndInitializationNotOnSeparateLines.ql

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,9 @@ where
5555
//omit the cases where there is one struct identifier on a struct var line used with typedef
5656
not exists(Struct s | s.getADeclarationEntry() = e1 and e1 instanceof TypeDeclarationEntry) and
5757
not exists(Struct s | s.getATypeNameUse() = e1 and e1 instanceof TypeDeclarationEntry) and
58-
exists(Location l1, Location l2 |
59-
e1.getLocation() = l1 and
60-
e2.getLocation() = l2 and
61-
not l1 = l2 and
62-
l1.getFile() = l2.getFile() and
63-
l1.getStartLine() = l2.getStartLine()
58+
exists(string file, int startline |
59+
e1.getLocation().hasLocationInfo(file, startline, _, _, _) and
60+
e2.getLocation().hasLocationInfo(file, startline, _, _, _) and
61+
not e1.getLocation() = e2.getLocation()
6462
)
6563
select e1, "Expression statement and identifier are on the same line."

0 commit comments

Comments
 (0)