diff --git a/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/TypeDefinitionRocks.cs b/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/TypeDefinitionRocks.cs index c62cb11f1..690a7fe84 100644 --- a/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/TypeDefinitionRocks.cs +++ b/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/TypeDefinitionRocks.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using Mono.Cecil; @@ -74,7 +73,12 @@ public static bool IsSubclassOf (this TypeDefinition type, string typeName) => public static bool IsSubclassOf (this TypeDefinition type, string typeName, TypeDefinitionCache cache) { - return type.GetTypeAndBaseTypes (cache).Any (t => t.FullName == typeName); + foreach (var t in type.GetTypeAndBaseTypes (cache)) { + if (t.FullName == typeName) { + return true; + } + } + return false; } [Obsolete ("Use the TypeDefinitionCache overload for better performance.")]