Skip to content

Commit a8784e1

Browse files
Simplify DeduplicateMacroResults::Report::ReportResult::toString() for performance reasons
1 parent 333cc77 commit a8784e1

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Diff for: cpp/common/src/codingstandards/cpp/alertreporting/DeduplicateMacroResults.qll

+15-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,21 @@ module DeduplicateMacroResults<
302302
* signature parameter.
303303
*/
304304
class ReportResult extends TReportResult {
305-
string toString() { result = getMessage() }
305+
string toString() {
306+
this = TReportMacroResultWithVariedName(_) and
307+
result =
308+
"Macro that always expands to a result element with invocation-dependent description"
309+
or
310+
this = TReportMacroResultWithSameName(_) and
311+
result = "Macro that always expands to a result element with a constant description"
312+
or
313+
this = TReportIsolatedMacroResult(_) and
314+
result =
315+
"Specific macro expansion which produces a result element, but not all expansions do"
316+
or
317+
this = TReportNotInMacro(_) and
318+
result = "Result element that is not in a macro"
319+
}
306320

307321
string getMessage() {
308322
exists(PrimaryMacroDifferentResultElementInAllInvocations def |

0 commit comments

Comments
 (0)