Python: Minor rewrite removing unnecessary exists

Co-authored-by: Taus <tausbn@github.com>
This commit is contained in:
Rasmus Wriedt Larsen
2023-01-17 10:40:31 +01:00
parent 608b16c98a
commit 479f019eb0

View File

@@ -702,7 +702,7 @@ Function findFunctionAccordingToMro(Class cls, string name) {
result = cls.getAMethod() and
result.getName() = name
or
not exists(Function f | f.getName() = name and f = cls.getAMethod()) and
not cls.getAMethod().getName() = name and
result = findFunctionAccordingToMro(getNextClassInMro(cls), name)
}
@@ -733,7 +733,7 @@ private Function findFunctionAccordingToMroKnownStartingClass(
result.getName() = name and
cls = getADirectSuperclass*(startingClass)
or
not exists(Function f | f.getName() = name and f = cls.getAMethod()) and
not cls.getAMethod().getName() = name and
result =
findFunctionAccordingToMroKnownStartingClass(getNextClassInMroKnownStartingClass(cls,
startingClass), startingClass, name)