From a94fd87b05aa23d453d6e238746b5a55e75544bd Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Tue, 17 Nov 2020 01:27:27 +0100 Subject: Avoid calling Object_isA from inside Vector_isConsistent --- Object.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'Object.c') diff --git a/Object.c b/Object.c index 975c8d48..0a29d015 100644 --- a/Object.c +++ b/Object.c @@ -21,13 +21,10 @@ bool Object_isA(const Object* o, const ObjectClass* klass) { if (!o) return false; - const ObjectClass* type = o->klass; - while (type) { + for (const ObjectClass* type = o->klass; type; type = type->extends) { if (type == klass) { return true; } - - type = type->extends; } return false; -- cgit v1.2.3