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

Commit9a1d770

Browse files
authored
Merge pull request#858 from github/lcartey/2.19.4-perf-improvements
2.19.4 upgrade performance improvements
2 parents6bcfc49 +98944ee commit9a1d770

File tree

3 files changed

+28
-24
lines changed

3 files changed

+28
-24
lines changed

‎cpp/autosar/src/codingstandards/cpp/HardwareOrProtocolInterface.qll‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ import codingstandards.cpp.CommonTypes as CommonTypes
33

44
abstractclassHardwareOrProtocolInterfaceClassextendsClass{}
55

6+
classHardwareOrProtocolInterfaceCommentextendsComment{
7+
HardwareOrProtocolInterfaceComment(){
8+
exists(getContents().regexpFind("(?m)^\\s*(//|\\*)\\s*@HardwareOrProtocolInterface\\s*$", _, _))
9+
}
10+
}
11+
612
classAnnotatedHardwareOrProtocolInterfaceClassextendsHardwareOrProtocolInterfaceClass{
713
AnnotatedHardwareOrProtocolInterfaceClass(){
8-
exists(Commentc,stringcontents|
9-
c.getCommentedElement()=this.getADeclarationEntry()and
10-
contents=
11-
c.getContents()
12-
.splitAt("\n")
13-
.regexpFind("^\\s*(//|\\*)\\s*@HardwareOrProtocolInterface\\s*$", _, _)
14+
exists(HardwareOrProtocolInterfaceCommentc|
15+
c.getCommentedElement()=this.getADeclarationEntry()
1416
)
1517
}
1618
}

‎cpp/autosar/src/rules/A2-3-1/InvalidCharacterInComment.ql‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,23 @@
1818
import cpp
1919
import codingstandards.cpp.autosar
2020

21-
bindingset[s]
22-
stringgetCharOutsideBasicSourceCharSet(strings){
23-
result=s.regexpFind("[\\u0000-\\u007f]", _, _)and
24-
notresult.regexpMatch("[\\p{Alnum}\\p{Space}_{}\\[\\]#()<>%:;.?*+-/^&|~!=,\\\\\"'@]")
25-
or
26-
result=s.regexpFind("[\\u00c0-\\u00df][\\u0080-\\u00bf]", _, _)
27-
or
28-
result=s.regexpFind("[\\u00e0-\\u00ef][\\u0080-\\u00bf]{2}", _, _)
29-
or
30-
result=s.regexpFind("[\\u00f0-\\u00f7][\\u0080-\\u00bf]{3}", _, _)
21+
stringgetCharOutsideBasicSourceCharSet(Commentc){
22+
exists(strings|s=c.getContents()|
23+
result=
24+
s.regexpFind("(?![\\p{Alnum}\\p{Space}_{}\\[\\]#()<>%:;.?*+-/^&|~!=,\\\\\"'@])[\\u0000-\\u007f]",
25+
_, _)
26+
or
27+
result=s.regexpFind("[\\u00c0-\\u00df][\\u0080-\\u00bf]", _, _)
28+
or
29+
result=s.regexpFind("[\\u00e0-\\u00ef][\\u0080-\\u00bf]{2}", _, _)
30+
or
31+
result=s.regexpFind("[\\u00f0-\\u00f7][\\u0080-\\u00bf]{3}", _, _)
32+
)
3133
}
3234

3335
fromCommentc,stringch
3436
where
3537
notisExcluded(c, NamingPackage::invalidCharacterInCommentQuery())and
36-
ch=getCharOutsideBasicSourceCharSet(c.getContents())
38+
ch=getCharOutsideBasicSourceCharSet(c)
3739
selectc,
3840
"Comment uses the character '"+ch+"' that is outside the language basic character set."

‎cpp/common/src/codingstandards/cpp/rules/orderingpredicatemustbestrictlyweak/OrderingPredicateMustBeStrictlyWeak.qll‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ abstract class OrderingPredicateMustBeStrictlyWeakSharedQuery extends Query { }
1414

1515
QuerygetQuery(){resultinstanceofOrderingPredicateMustBeStrictlyWeakSharedQuery}
1616

17+
classIsStrictlyWeaklyOrderedCommentextendsComment{
18+
IsStrictlyWeaklyOrderedComment(){
19+
exists(getContents().regexpFind("(?m)^\\s*(//|\\*)\\s*@IsStrictlyWeaklyOrdered\\s*$", _, _))
20+
}
21+
}
22+
1723
/**
1824
* User annotated class indicating a comparator is axiomatically strictly weakly
1925
* ordering.
2026
*/
2127
classUserDefinedStrictlyWeakOrderingComparatorextendsClass{
2228
UserDefinedStrictlyWeakOrderingComparator(){
23-
exists(Commentc,stringcontents|
24-
c.getCommentedElement()=this.getADeclarationEntry()and
25-
contents=
26-
c.getContents()
27-
.splitAt("\n")
28-
.regexpFind("^\\s*(//|\\*)\\s*@IsStrictlyWeaklyOrdered\\s*$", _, _)
29-
)
29+
exists(IsStrictlyWeaklyOrderedCommentc|c.getCommentedElement()=this.getADeclarationEntry())
3030
}
3131
}
3232

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp