simplify isBindable check method

This commit is contained in:
Dima Granetchi
2017-02-03 03:09:32 +03:00
parent 9e197d9a69
commit 5294568a72
+7 -8
View File
@@ -96,16 +96,15 @@ class BindMacros {
static inline function isBindable(classType:ClassType):Bool {
var check = [classType];
var res = false;
while (check.length > 0 && !res) {
while (!res && check.length > 0) {
var t = check.shift();
while (t != null) {
if (t.module == "bindx.IBindable" && t.name == "IBindable") {
res = true;
break;
while (!res && t != null) {
switch t {
case {module: "bindx.IBindable", name: "IBindable"}: res = true;
case _:
for (it in t.interfaces) check.push(it.t.get());
t = t.superClass != null ? t.superClass.t.get() : null;
}
for (it in t.interfaces)
check.push(it.t.get());
t = t.superClass != null ? t.superClass.t.get() : null;
}
}
return res;