Skip to content

Commit 479f019

Browse files
RasmusWLtausbn
andcommitted
Python: Minor rewrite removing unnecessary exists
Co-authored-by: Taus <[email protected]>
1 parent 608b16c commit 479f019

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/ql/lib/semmle/python/dataflow/new/internal/DataFlowDispatch.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ Function findFunctionAccordingToMro(Class cls, string name) {
702702
result = cls.getAMethod() and
703703
result.getName() = name
704704
or
705-
not exists(Function f | f.getName() = name and f = cls.getAMethod()) and
705+
not cls.getAMethod().getName() = name and
706706
result = findFunctionAccordingToMro(getNextClassInMro(cls), name)
707707
}
708708

@@ -733,7 +733,7 @@ private Function findFunctionAccordingToMroKnownStartingClass(
733733
result.getName() = name and
734734
cls = getADirectSuperclass*(startingClass)
735735
or
736-
not exists(Function f | f.getName() = name and f = cls.getAMethod()) and
736+
not cls.getAMethod().getName() = name and
737737
result =
738738
findFunctionAccordingToMroKnownStartingClass(getNextClassInMroKnownStartingClass(cls,
739739
startingClass), startingClass, name)

0 commit comments

Comments
 (0)