From 8a31f15d641aef53d26e1982e81f372a822468f9 Mon Sep 17 00:00:00 2001 From: vis2k Date: Wed, 2 Jan 2019 17:08:32 +0100 Subject: [PATCH] Weaver.CanBeResolved moved to Extensions --- Mirror/Weaver/Extensions.cs | 27 +++++++++++++++++++++++++++ Mirror/Weaver/Weaver.cs | 29 +---------------------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Mirror/Weaver/Extensions.cs b/Mirror/Weaver/Extensions.cs index 970128fbc..2e5267005 100644 --- a/Mirror/Weaver/Extensions.cs +++ b/Mirror/Weaver/Extensions.cs @@ -74,5 +74,32 @@ public static bool IsArrayType(this TypeReference tr) return false; return true; } + + public static bool CanBeResolved(this TypeReference parent) + { + while (parent != null) + { + if (parent.Scope.Name == "Windows") + { + return false; + } + + if (parent.Scope.Name == "mscorlib") + { + TypeDefinition resolved = parent.Resolve(); + return resolved != null; + } + + try + { + parent = parent.Resolve().BaseType; + } + catch + { + return false; + } + } + return true; + } } } \ No newline at end of file diff --git a/Mirror/Weaver/Weaver.cs b/Mirror/Weaver/Weaver.cs index e030708a0..5caac2f96 100644 --- a/Mirror/Weaver/Weaver.cs +++ b/Mirror/Weaver/Weaver.cs @@ -182,33 +182,6 @@ public static void ResetRecursionCount() s_RecursionCount = 0; } - public static bool CanBeResolved(TypeReference parent) - { - while (parent != null) - { - if (parent.Scope.Name == "Windows") - { - return false; - } - - if (parent.Scope.Name == "mscorlib") - { - var resolved = parent.Resolve(); - return resolved != null; - } - - try - { - parent = parent.Resolve().BaseType; - } - catch - { - return false; - } - } - return true; - } - public static void DLog(TypeDefinition td, string fmt, params object[] args) { if (!m_DebugFlag) @@ -1429,7 +1402,7 @@ static bool Weave(string assName, IEnumerable dependencies, IAssemblyRes var watch = System.Diagnostics.Stopwatch.StartNew(); foreach (TypeDefinition td in moduleDefinition.Types) { - if (td.IsClass && CanBeResolved(td.BaseType)) + if (td.IsClass && td.BaseType.CanBeResolved()) { try {