forked from M-Labs/artiq
compiler.types: replace isinstance() with .__class__==.
This provides a 50% speedup.
This commit is contained in:
parent
6122fd70ca
commit
237e983770
@ -64,7 +64,7 @@ class TVar(Type):
|
||||
# because paths resulting from unification of large arrays
|
||||
# can easily cause a stack overflow.
|
||||
root = self
|
||||
while isinstance(root, TVar):
|
||||
while root.__class__ == TVar:
|
||||
if root is root.parent:
|
||||
break
|
||||
else:
|
||||
@ -72,7 +72,7 @@ class TVar(Type):
|
||||
|
||||
# path compression
|
||||
iter = self
|
||||
while isinstance(iter, TVar):
|
||||
while iter.__class__ == TVar:
|
||||
if iter is iter.parent:
|
||||
break
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user