summaryrefslogtreecommitdiffstats
path: root/Object.c
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2020-11-17 01:27:27 +0100
committerBenBE <BenBE@geshi.org>2020-11-17 08:06:02 +0100
commita94fd87b05aa23d453d6e238746b5a55e75544bd (patch)
tree83c455f7aef55b120e6360bed623eaae76ce379f /Object.c
parent307c34b028d353154aa268eceb38e0331c8275cf (diff)
Avoid calling Object_isA from inside Vector_isConsistent
Diffstat (limited to 'Object.c')
-rw-r--r--Object.c5
1 files changed, 1 insertions, 4 deletions
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;

© 2014-2024 Faster IT GmbH | imprint | privacy policy