Skip to content
Permalink
Browse files

Check only native types in Construct for isInstanceOf(). (#543)

This is optimal in cases we can expect it to not be a UserObject.
  • Loading branch information
PseudoKnight authored and LadyCailin committed Nov 4, 2019
1 parent da19ddd commit e9735c847096b4ab2c15fcb451720df417303a71
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/main/java/com/laytonsmith/core/constructs/Construct.java
@@ -593,12 +593,15 @@ public static boolean isInstanceof(Mixed that, Class<? extends Mixed> type) {

@Override
public boolean isInstanceOf(CClassType type) {
if(type.getNativeType() != null) {
return type.getNativeType().isAssignableFrom(this.getClass());
}
return isInstanceof(this, type);
}

@Override
public boolean isInstanceOf(Class<? extends Mixed> type) {
return isInstanceof(this, type);
return type.isAssignableFrom(this.getClass());
}

/**

0 comments on commit e9735c8

Please sign in to comment.
You can’t perform that action at this time.