Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdfdfe9b

Browse files
committed
NotDistinctIdentifier: Performance optimization
Hint optimizer to perform join of exclusions after determiningresults.
1 parent7eaad20 commitdfdfe9b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

‎cpp/common/src/codingstandards/cpp/rules/notdistinctidentifier/NotDistinctIdentifier.qll‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ abstract class NotDistinctIdentifierSharedQuery extends Query { }
1212

1313
QuerygetQuery(){resultinstanceofNotDistinctIdentifierSharedQuery}
1414

15+
bindingset[d, d2]
16+
pragma[inline_late]
17+
privatepredicateafter(ExternalIdentifiersd,ExternalIdentifiersd2){
18+
exists(intdStartLine,intd2StartLine|
19+
d.getLocation().hasLocationInfo(_,dStartLine, _, _, _)and
20+
d2.getLocation().hasLocationInfo(_,d2StartLine, _, _, _)and
21+
dStartLine>=d2StartLine
22+
)
23+
}
24+
1525
querypredicateproblems(
1626
ExternalIdentifiersd,stringmessage,ExternalIdentifiersd2,stringnameplaceholder
1727
){
@@ -20,10 +30,10 @@ query predicate problems(
2030
d.getName().length()>=31and
2131
d2.getName().length()>=31and
2232
notd=d2and
23-
d.getLocation().getStartLine()>=d2.getLocation().getStartLine()and
2433
d.getSignificantName()=d2.getSignificantName()and
2534
notd.getName()=d2.getName()and
2635
nameplaceholder=d2.getName()and
36+
after(d,d2)and
2737
message=
2838
"External identifer "+d.getName()+
2939
" is nondistinct in characters at or over 31 limit, compared to $@"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp