Skip to content

Commit fb5c4bc

Browse files
committed
Fix A2-7-3 performance issue
Caches `isDocumented` and `isBetweenDoxygenCommentGroup`
1 parent 9f5b134 commit fb5c4bc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cpp/autosar/src/rules/A2-7-3/UndocumentedUserDefinedType.ql

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ private string doxygenCommentGroupStrings(boolean opening) {
3131
opening = false and result = ["///@}", "/**@}*/"]
3232
}
3333

34+
pragma[inline]
3435
private predicate isBetweenDoxygenCommentGroup(
3536
Location loc, Comment opening, Comment body, Comment closing
3637
) {
@@ -115,6 +116,7 @@ class DocumentableDeclaration extends Declaration {
115116
* A `DeclarationEntry` is considered documented if it has an associated `Comment`, the `Comment`
116117
* precedes the `DeclarationEntry`, and the `Comment` is not a doxygen comment group prefix.
117118
*/
119+
cached
118120
predicate isDocumented(DeclarationEntry de) {
119121
exists(Comment c | c.getCommentedElement() = de |
120122
not c.getContents() = doxygenCommentGroupStrings(true) and

0 commit comments

Comments
 (0)