Python: Reduce size of attrReadTracker

On pallets/flask, this reduced the number of tuples from
100866 results => 33060 results
This commit is contained in:
Rasmus Wriedt Larsen
2022-09-08 17:13:57 +02:00
parent 61410191e7
commit 7014be2047

View File

@@ -585,7 +585,11 @@ Function findFunctionAccordingToMroKnownStartingClass(Class startingClass, strin
/** Gets a reference to the attribute read `attr` */
private TypeTrackingNode attrReadTracker(TypeTracker t, AttrRead attr) {
t.start() and
result = attr
result = attr and
attr.getObject() in [
classTracker(_), classInstanceTracker(_), selfTracker(_), clsTracker(_),
superCallNoArgumentTracker(_), superCallTwoArgumentTracker(_, _)
]
or
exists(TypeTracker t2 | result = attrReadTracker(t2, attr).track(t2, t))
}