Skip to content

Commit 7c58b28

Browse files
committed
Python: Write DataFlow::update more succinctly
This has no impact on performance, but it cleans up the code a bit, and (hopefully) makes it more readable.
1 parent bae4aca commit 7c58b28

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

python/ql/src/semmle/python/dataflow/new/internal/DataFlowPrivate.qll

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,7 @@ private predicate localEssaStep(EssaNode nodeFrom, EssaNode nodeTo) {
215215
* Holds if `result` is either `node`, or the post-update node for `node`.
216216
*/
217217
private Node update(Node node) {
218-
exists(PostUpdateNode pun |
219-
node = pun.getPreUpdateNode() and
220-
result = pun
221-
)
218+
node = result.(PostUpdateNode).getPreUpdateNode()
222219
or
223220
result = node
224221
}

0 commit comments

Comments
 (0)