Func* Func::findCachedClone(Class* cls) const { Func* nextFunc = const_cast<Func*>(this); while (nextFunc) { if (nextFunc->cls() == cls) { return nextFunc; } nextFunc = nextFunc->nextClonedClosure(); } return nullptr; }