Skip to content

Commit 748b2d2

Browse files
michaelnebelhvitved
andcommitted
C#: Simplify the ForEachCapture query.
Co-authored-by: Tom Hvitved <[email protected]>
1 parent fef6770 commit 748b2d2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

csharp/ql/src/Language Abuse/ForeachCapture.ql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,9 @@ Element getAssignmentTarget(Expr e) {
7575

7676
Element getCollectionAssignmentTarget(Expr e) {
7777
// Store into collection via method
78-
exists(DataFlow::Node postNode, Expr nodeExp |
78+
exists(DataFlowPrivate::PostUpdateNode postNode |
7979
FlowSummaryImpl::Private::Steps::summarySetterStep(DataFlow::exprNode(e), _, postNode) and
80-
nodeExp = postNode.(DataFlowPrivate::PostUpdateNode).getPreUpdateNode().asExpr() and
81-
result.(Variable).getAnAccess() = nodeExp
80+
result.(Variable).getAnAccess() = postNode.getPreUpdateNode().asExpr()
8281
)
8382
or
8483
// Array initializer

0 commit comments

Comments
 (0)