Skip to content

Commit 2617203

Browse files
committed
C#: Fix perf.
1 parent bdd1439 commit 2617203

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPublic.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,14 @@ AssignableDefinitionNode assignableDefinitionNode(AssignableDefinition def) {
133133

134134
predicate localFlowStep = localFlowStepImpl/2;
135135

136+
private predicate localFlowStepPlus(Node source, Node sink) = fastTC(localFlowStep/2)(source, sink)
137+
136138
/**
137139
* Holds if data flows from `source` to `sink` in zero or more local
138140
* (intra-procedural) steps.
139141
*/
140142
pragma[inline]
141-
predicate localFlow(Node source, Node sink) { localFlowStep*(source, sink) }
143+
predicate localFlow(Node source, Node sink) { localFlowStepPlus(source, sink) or source = sink }
142144

143145
/**
144146
* Holds if data can flow from `e1` to `e2` in zero or more

0 commit comments

Comments
 (0)