Lots of new optimizations utilizing prepatcher

To start, this mod now requires Prepatcher and Fishery.
New optimizations include: gene ticking improvements, world object improvements, hediff optimizations, world pawn gc optimizations, better mothballing, dds support, ContentFinder caching, additions and changes to reflection caching, as well as various other additions. Multiplayer support has been improved too, but should be considered highly experimental. The WorkGiver_DoBill bug is fixed in this build. Multiple patches aiming to improve RimWorld's load time have been added too.
This commit is contained in:
bbradson
2023-06-03 20:24:38 +02:00
parent cb0a407425
commit ca9321add8
125 changed files with 11272 additions and 3681 deletions
+204 -110
View File
@@ -1,4 +1,4 @@
// Copyright (c) 2022 bradson
// Copyright (c) 2023 bradson
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
@@ -7,6 +7,7 @@ using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection.Emit;
using System.Xml;
// ReSharper disable InconsistentNaming
namespace PerformanceFish;
@@ -14,22 +15,27 @@ public static class AnalyzerFixes
{
public static void Patch()
{
var modBase = AccessTools.Constructor(Reflection.Type("PerformanceAnalyzer", "Analyzer.Modbase"), new[] { typeof(ModContentPack) });
var modBase = AccessTools.Constructor(Reflection.Type("PerformanceAnalyzer", "Analyzer.Modbase"),
new[] { typeof(ModContentPack) });
if (modBase is null)
return /*false*/;
var success = PerformanceFishMod.Harmony.Patch(modBase, postfix: new(methodof(XmlParser.CollectXmlData))) != null;
var success = PerformanceFishMod.Harmony!.Patch(modBase, postfix: new(methodof(XmlParser.CollectXmlData)))
!= null;
var methodTransplanting = Reflection.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.MethodTransplanting", "UpdateMethod",
new[] { typeof(Type), typeof(MethodInfo) });
var methodTransplanting = Reflection.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.MethodTransplanting",
"UpdateMethod",
new[] { typeof(Type), typeof(MethodInfo) });
if (methodTransplanting is null
|| PerformanceFishMod.Harmony.Patch(methodTransplanting, transpiler: new(methodof(UpdateMethod_Transpiler))) is null)
|| PerformanceFishMod.Harmony.Patch(methodTransplanting, transpiler: new(methodof(UpdateMethod_Transpiler)))
is null)
{
success = false;
}
var panelLogs = Reflection.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.Panel_Logs", "RightClickDropDown");
var panelLogs
= Reflection.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.Panel_Logs", "RightClickDropDown");
if (panelLogs is null
|| PerformanceFishMod.Harmony.Patch(panelLogs, postfix: new(methodof(PanelLogs_Postfix))) is null)
@@ -47,14 +53,22 @@ public static class AnalyzerFixes
{
yield return FishTranspiler.ArgumentAddress(method, "meth");
yield return FishTranspiler.Call(UpdateMethod_Prefix);
foreach (var code in codes)
yield return code;
}
public static void UpdateMethod_Prefix(ref MethodInfo meth)
{
if (AccessTools.EnumeratorMoveNext(meth) is { } moveNext)
meth = moveNext;
try
{
if (AccessTools.EnumeratorMoveNext(meth) is { } moveNext)
meth = moveNext;
}
catch (Exception ex)
{
Log.Error($"Exception thrown while trying to profile method {meth.FullDescription()}:\n{ex}");
}
}
public static IEnumerable<FloatMenuOption> PanelLogs_Postfix(IEnumerable<FloatMenuOption> values, object log)
@@ -64,6 +78,7 @@ public static class AnalyzerFixes
foreach (var value in values)
{
yield return value;
if (IsValidMethodForOverriding(method) && !returned && value.Label == "Profile the internal methods of")
{
returned = true;
@@ -75,7 +90,7 @@ public static class AnalyzerFixes
private static bool IsValidMethodForOverriding([NotNullWhen(true)] MethodInfo? info)
=> info is not null
&& (info.IsVirtual || info.IsAbstract || info.GetBaseDefinition().DeclaringType != info.DeclaringType);
&& (info.IsVirtual || info.IsAbstract || info.GetBaseDefinition().DeclaringType != info.DeclaringType);
public enum Category
{
@@ -86,12 +101,16 @@ public static class AnalyzerFixes
Modder
}
public static void PatchOverridesForMethod(MethodInfo method, Category category)
public static void PatchOverridesForMethod(MethodInfo? method, Category category)
{
if (method is null)
return;
if (OverridingMethodUtility.PatchedOverrides.Contains(method))
{
var signature = Utility_GetSignature(method, true);
Messages.Message("Have already patched overrides for the method " + signature, MessageTypeDefOf.CautionInput, false);
Messages.Message("Have already patched overrides for the method " + signature,
MessageTypeDefOf.CautionInput, false);
Utility_Warn("Trying to repeat patching already profiled overrides of method - " + signature);
}
else
@@ -141,7 +160,8 @@ public static class AnalyzerFixes
foreach (var subClass in subClasses)
{
var overridingMethod = Array.Find(subClass.GetMethods(AccessTools.allDeclared), m => m.GetBaseDefinition() == method.GetBaseDefinition());
var overridingMethod = Array.Find(subClass.GetMethods(AccessTools.allDeclared),
m => m.GetBaseDefinition() == method.GetBaseDefinition());
if (overridingMethod is null || overridingMethod.IsAbstract)
continue;
@@ -159,55 +179,70 @@ public static class AnalyzerFixes
public static AccessTools.FieldRef<object, MethodBase> ProfileLog_meth
=> _profileLog_meth
??= AccessTools.FieldRefAccess<object, MethodBase>(Reflection.FieldInfo("PerformanceAnalyzer", "Analyzer.Profiling.ProfileLog", "meth"));
??= AccessTools.FieldRefAccess<object, MethodBase>(Reflection.FieldInfo("PerformanceAnalyzer",
"Analyzer.Profiling.ProfileLog", "meth"));
private static AccessTools.FieldRef<object, MethodBase>? _profileLog_meth;
public static Func<Harmony> Modbase_Harmony
=> _modbase_Harmony
??= (Func<Harmony>)Reflection.MethodInfo("PerformanceAnalyzer", "Analyzer.Modbase", "get_Harmony")
.CreateDelegate(typeof(Func<Harmony>));
??= (Func<Harmony>)Reflection.MethodInfo("PerformanceAnalyzer", "Analyzer.Modbase", "get_Harmony")!
.CreateDelegate(typeof(Func<Harmony>));
private static Func<Harmony>? _modbase_Harmony;
public static Action<string, int> GUIController_AddEntry
=> _guiController_AddEntry
??= (Action<string, int>)Reflection.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.GUIController", "AddEntry")
.CreateDelegate(typeof(Action<string, int>));
??= (Action<string, int>)Reflection
.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.GUIController", "AddEntry")!
.CreateDelegate(typeof(Action<string, int>));
private static Action<string, int>? _guiController_AddEntry;
public static Action<string> GUIController_SwapToEntry
=> _guiController_SwapToEntry
??= (Action<string>)Reflection.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.GUIController", "SwapToEntry")
.CreateDelegate(typeof(Action<string>));
??= (Action<string>)Reflection
.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.GUIController", "SwapToEntry")!
.CreateDelegate(typeof(Action<string>));
private static Action<string>? _guiController_SwapToEntry;
public static Func<MethodBase, bool, string> Utility_GetSignature
=> _utility_GetSignature
??= (Func<MethodBase, bool, string>)Reflection.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.Utility", "GetSignature")
.CreateDelegate(typeof(Func<MethodBase, bool, string>));
??= (Func<MethodBase, bool, string>)Reflection
.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.Utility", "GetSignature")!
.CreateDelegate(typeof(Func<MethodBase, bool, string>));
private static Func<MethodBase, bool, string>? _utility_GetSignature;
public static Func<int> GUIController_CurrentCategory
=> _guiController_CurrentCategory
??= (Func<int>)Reflection.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.GUIController", "get_CurrentCategory")
.CreateDelegate(typeof(Func<int>));
??= (Func<int>)Reflection.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.GUIController",
"get_CurrentCategory")!
.CreateDelegate(typeof(Func<int>));
private static Func<int>? _guiController_CurrentCategory;
public static Action<string> Utility_Warn
=> _utility_Warn
??= (Action<string>)Reflection.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.Utility", "Warn")
.CreateDelegate(typeof(Action<string>));
??= (Action<string>)Reflection.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.Utility", "Warn")!
.CreateDelegate(typeof(Action<string>));
private static Action<string>? _utility_Warn;
public static Action<Exception, string> Utility_ReportException
=> _utility_ReportException
??= (Action<Exception, string>)Reflection.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.Utility", "ReportException")
.CreateDelegate(typeof(Action<Exception, string>));
??= (Action<Exception, string>)Reflection
.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.Utility", "ReportException")!
.CreateDelegate(typeof(Action<Exception, string>));
private static Action<Exception, string>? _utility_ReportException;
public static Action<string> Utility_Error
=> _utility_Error
??= (Action<string>)Reflection.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.Utility", "Error")
.CreateDelegate(typeof(Action<string>));
??= (Action<string>)Reflection.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.Utility", "Error")!
.CreateDelegate(typeof(Action<string>));
private static Action<string>? _utility_Error;
public static CodeInstructions Parse_Transpiler(CodeInstructions CodeInstructions)
@@ -222,7 +257,9 @@ public static class AnalyzerFixes
{
yield return new(codes[i - 2]); //Ldloc xmlNode
yield return FishTranspiler.Call(ParseMethod_Fixed);
yield return FishTranspiler.Call<Action<HashSet<MethodInfo>, IEnumerable<MethodInfo>>>(GenCollection.AddRange);
yield return FishTranspiler.Call<Action<HashSet<MethodInfo>, IEnumerable<MethodInfo>>>(GenCollection
.AddRange);
i += 2; //removing OpCodes.Pop
}
else if (codes[i] == errorMethod)
@@ -239,24 +276,41 @@ public static class AnalyzerFixes
public static IEnumerable<MethodInfo> ParseMethod_Fixed(string info, XmlNode node)
=> node.NodeType == XmlNodeType.Comment
? Enumerable.Empty<MethodInfo>()
: ParseMethod(info);
? Enumerable.Empty<MethodInfo>()
: ParseMethod(info);
private static IEnumerable<MethodInfo> ParseMethod(string info)
{
var array = info.Split(':');
if (array.Length != 2)
throw new ArgumentException($"Method must be specified as 'Namespace.Type1.Type2:MethodName. Got {info} instead.", nameof(info));
{
throw new ArgumentException($"Method must be specified as 'Namespace.Type1.Type2:MethodName. Got {
info} instead.", nameof(info));
}
var methods = Reflection.MethodsOfName(AccessTools.TypeByName(array[0]), array[1]);
foreach (var method in methods)
{
yield return method.IsGenericMethodDefinition
? method.MakeGenericMethod(method.GetGenericArguments().Select(t => t.GetGenericParameterConstraints() is var constraints2 && constraints2.Length != 0 ? constraints2[0] : typeof(object)).ToArray())
? method.MakeGenericMethod(GetTypeArguments(method))
: method;
}
}
private static Type[] GetTypeArguments(MethodBase method)
{
var genericArguments = method.GetGenericArguments();
var resultArray = new Type[genericArguments.Length];
for (var i = 0; i < genericArguments.Length; i++)
{
resultArray[i] = genericArguments[i].GetGenericArguments() is var constraints && constraints.Length != 0
? constraints[0]
: typeof(object);
}
return resultArray;
}
public static void ErrorFix(string message, XmlNode node)
{
if (node.NodeType == XmlNodeType.Comment)
@@ -267,29 +321,40 @@ public static class AnalyzerFixes
public static Action<string> ThreadSafeLogger_Error
=> _threadSafeLogger_Error
??= (Action<string>)Reflection.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.ThreadSafeLogger", "Error")
.CreateDelegate(typeof(Action<string>));
??= (Action<string>)Reflection
.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.ThreadSafeLogger", "Error")!
.CreateDelegate(typeof(Action<string>));
private static Action<string>? _threadSafeLogger_Error;
public static Func<string, HashSet<MethodInfo>, Type> DynamicTypeBuilder_CreateType
=> _dynamicTypeBuilder_CreateType
??= (Func<string, HashSet<MethodInfo>, Type>)Reflection.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.DynamicTypeBuilder", "CreateType")
.CreateDelegate(typeof(Func<string, HashSet<MethodInfo>, Type>));
??= (Func<string, HashSet<MethodInfo>, Type>)Reflection.MethodInfo("PerformanceAnalyzer",
"Analyzer.Profiling.DynamicTypeBuilder", "CreateType")!
.CreateDelegate(typeof(Func<string, HashSet<MethodInfo>, Type>));
private static Func<string, HashSet<MethodInfo>, Type>? _dynamicTypeBuilder_CreateType;
public static Func<Type, bool, IEnumerable<MethodInfo>> Utility_GetTypeMethods
=> _utility_GetTypeMethods
??= (Func<Type, bool, IEnumerable<MethodInfo>>)Reflection.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.Utility", "GetTypeMethods")
.CreateDelegate(typeof(Func<Type, bool, IEnumerable<MethodInfo>>));
??= (Func<Type, bool, IEnumerable<MethodInfo>>)Reflection.MethodInfo("PerformanceAnalyzer",
"Analyzer.Profiling.Utility", "GetTypeMethods")!
.CreateDelegate(typeof(Func<Type, bool, IEnumerable<MethodInfo>>));
private static Func<Type, bool, IEnumerable<MethodInfo>>? _utility_GetTypeMethods;
public static AccessTools.FieldRef<object, string> Entry_tip
=> _entry_tip
??= AccessTools.FieldRefAccess<string>(Type.GetType("Analyzer.Profiling.Entry, PerformanceAnalyzer"), "tip");
??= AccessTools.FieldRefAccess<string>(Type.GetType("Analyzer.Profiling.Entry, PerformanceAnalyzer"),
"tip");
private static AccessTools.FieldRef<object, string>? _entry_tip;
public static Action<int, object, Type> GUIController_AddSpecificEntry => _guiController_AddSpecificEntry ??= MakeGUIController_AddEntryMethod();
public static Action<int, object, Type> GUIController_AddSpecificEntry
=> _guiController_AddSpecificEntry ??= MakeGUIController_AddEntryMethod();
private static Action<int, object, Type>? _guiController_AddSpecificEntry;
private static Action<int, object, Type> MakeGUIController_AddEntryMethod()
{
var analyzer_Profiling_EntryType = Reflection.Type("PerformanceAnalyzer", "Analyzer.Profiling.Entry");
@@ -312,17 +377,19 @@ public static class AnalyzerFixes
if (entry_Create == null)
Log.Error("entry_Create is null");*/
var dictionary_Add = AccessTools.Method(typeof(Dictionary<,>).MakeGenericType(new[] { analyzer_Profiling_EntryType, typeof(Type) }),
"Add", new[] { analyzer_Profiling_EntryType, typeof(Type) });
var dictionary_Add = AccessTools.Method(
typeof(Dictionary<,>).MakeGenericType(new[] { analyzer_Profiling_EntryType, typeof(Type) }),
"Add", new[] { analyzer_Profiling_EntryType, typeof(Type) });
if (dictionary_Add == null)
Log.Error("dictionary_Add is null");
var dynamicMethod = new DynamicMethod("GUIController_AddEntryMethod", typeof(void), new[] { typeof(int), typeof(object), typeof(Type) });
var dynamicMethod = new DynamicMethod("GUIController_AddEntryMethod", typeof(void),
new[] { typeof(int), typeof(object), typeof(Type) });
var il = dynamicMethod.GetILGenerator();
il.Emit(FishTranspiler.Argument(0)); //Category
il.Emit(FishTranspiler.Argument(0)); //Category
il.Emit(FishTranspiler.Call(gUIController_Tab!)); //Tab(Category)
il.Emit(FishTranspiler.Field(tab_entries!)); //tab.entries
il.Emit(FishTranspiler.Field(tab_entries!)); //tab.entries
/*il.Emit(FishTranspiler.Argument(2)); //type
il.Emit(FishTranspiler.Call(memberInfo_Name)); //type.Name
il.Emit(FishTranspiler.LoadConstant(4)); //Category.Modder
@@ -330,16 +397,20 @@ public static class AnalyzerFixes
il.Emit(FishTranspiler.LoadConstant(0)); //closeable = false
il.Emit(FishTranspiler.LoadConstant(1)); //dynGen = true
il.Emit(FishTranspiler.Call(entry_Create)); //Create(string, Category, Type, bool, bool)*/
il.Emit(FishTranspiler.Argument(1)); //entry
il.Emit(FishTranspiler.Argument(2)); //type
il.Emit(FishTranspiler.Argument(1)); //entry
il.Emit(FishTranspiler.Argument(2)); //type
il.Emit(FishTranspiler.Call(dictionary_Add!)); //entries.Add(Entry, Type)
il.Emit(FishTranspiler.Return);
return (Action<int, object, Type>)dynamicMethod.CreateDelegate(typeof(Action<int, object, Type>));
}
public static Func<string, int, Type, bool, bool, object> Entry_Create => _entry_Create
??= (Func<string, int, Type, bool, bool, object>)Reflection.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.Entry", "Create").CreateDelegate(typeof(Func<string, int, Type, bool, bool, object>));
public static Func<string, int, Type, bool, bool, object> Entry_Create
=> _entry_Create
??= (Func<string, int, Type, bool, bool, object>)Reflection
.MethodInfo("PerformanceAnalyzer", "Analyzer.Profiling.Entry", "Create")!
.CreateDelegate(typeof(Func<string, int, Type, bool, bool, object>));
private static Func<string, int, Type, bool, bool, object>? _entry_Create;
//Copied from Wiri's analyzer fork, with above fixes integrated. The steam version lacks this functionality
@@ -350,72 +421,93 @@ public static class AnalyzerFixes
foreach (var dir in ModLister.AllActiveModDirs)
{
var xmlFiles = dir.GetFiles("DubsAnalyzer.xml");
if (xmlFiles.Length != 0)
{
foreach (var file in xmlFiles)
{
var doc = new XmlDocument();
doc.Load(file.OpenRead());
if (xmlFiles.Length == 0)
continue;
Parse(doc);
}
foreach (var file in xmlFiles)
{
var doc = new XmlDocument();
doc.Load(file.OpenRead());
Parse(doc);
}
}
}
// Iterates through each child element in the document and attempts to extract method(s) from the strings inside the children
private static void Parse(XmlDocument doc)
=> ForEach(doc.DocumentElement.ChildNodes, node =>
=> ForEach(doc.DocumentElement!.ChildNodes, ParseChildNodes);
private static void ParseChildNodes(XmlNode node)
{
var methods = new HashSet<MethodInfo>();
var tip = string.Empty;
var category = (int)Category.Modder;
ForEach(node.ChildNodes, child =>
{
var methods = new HashSet<MethodInfo>();
var tip = string.Empty;
var category = (int)Category.Modder;
ForEach(node.ChildNodes, child =>
switch (child.Name.ToUpperInvariant())
{
switch (child.Name.ToLowerInvariant())
{
case "category":
category = (int)Enum.Parse(typeof(Category), child.InnerText, true); //child.InnerText;
break;
case "tooltip":
case "tip":
case "description":
tip += child.InnerText;
break;
case "methods":
case "method":
AddMethodsFromChildNodes(child, methods, ParseMethod);
break;
case "derivedmethods":
AddMethodsFromChildNodes(child, methods, ParseDerivedMethods);
break;
case "types":
case "type":
AddMethodsFromChildNodes(child, methods, ParseTypeMethods);
break;
case "derivedtypes":
AddMethodsFromChildNodes(child, methods, ParseDerivedTypeMethods);
break;
case "nestedtype":
case "nestedtypes":
AddMethodsFromChildNodes(child, methods, ParseNestedTypeMethods);
break;
default:
ThreadSafeLogger_Error($"[Analyzer] Attempting to read unknown value from a DubsAnalyzer.xml, the given input was {child.Name}, it should have been either 'methods', 'types', 'derivedMethods', 'derivedTypes', 'nestedTypes', 'category' or 'tooltip'");
break;
}
});
var type = DynamicTypeBuilder_CreateType(node.Name, methods);
var entry = Entry_Create(node.Name, category, type, false, true);
if (tip != string.Empty)
Entry_tip(entry) = tip;
GUIController_AddSpecificEntry(category, entry, type);
case "CATEGORY":
category = (int)Enum.Parse(typeof(Category), child.InnerText, true);
break;
case "TOOLTIP":
case "TIP":
case "DESCRIPTION":
tip += child.InnerText;
break;
case "METHODS":
case "METHOD":
AddMethodsFromChildNodes(child, methods, ParseMethod);
break;
case "DERIVEDMETHODS":
AddMethodsFromChildNodes(child, methods, ParseDerivedMethods);
break;
case "TYPES":
case "TYPE":
AddMethodsFromChildNodes(child, methods, ParseTypeMethods);
break;
case "DERIVEDTYPES":
AddMethodsFromChildNodes(child, methods, ParseDerivedTypeMethods);
break;
case "NESTEDTYPE":
case "NESTEDTYPES":
AddMethodsFromChildNodes(child, methods, ParseNestedTypeMethods);
break;
default:
ThreadSafeLogger_Error("[Analyzer] Attempting to read unknown value from a DubsAnalyzer.xml, "
+ $"the given input was {child.Name}, it should have been either 'methods', 'types', "
+ "'derivedMethods', 'derivedTypes', 'nestedTypes', 'category' or 'tooltip'");
break;
}
});
var type = DynamicTypeBuilder_CreateType(node.Name, methods);
var entry = Entry_Create(node.Name, category, type, false, true);
if (tip != string.Empty)
Entry_tip(entry) = tip;
private static void AddMethodsFromChildNodes(XmlNode node, HashSet<MethodInfo> methods, Func<string, IEnumerable<MethodInfo>> func)
=> ForEach(node.ChildNodes, childNode
=> methods.AddRange(func(childNode.InnerText)));
GUIController_AddSpecificEntry(category, entry, type);
}
private static void AddMethodsFromChildNodes(XmlNode node, HashSet<MethodInfo> methods,
Func<string, IEnumerable<MethodInfo>> func)
{
var nodes = node.ChildNodes;
foreach (XmlNode childNode in nodes)
{
if (MissingRequiredMod(childNode.Attributes))
continue;
if (childNode.NodeType != XmlNodeType.Comment)
methods.AddRange(func(childNode.InnerText));
}
}
private static bool MissingRequiredMod(XmlAttributeCollection? attributes)
=> attributes?["MayRequire"] is { } mayRequireAttribute
&& ModLister.GetActiveModWithIdentifier(mayRequireAttribute.Value, true) is null;
private static void ForEach(XmlNodeList nodes, Action<XmlNode> action)
{
@@ -434,7 +526,8 @@ public static class AnalyzerFixes
foreach (var subClass in subClasses)
{
var overridingMethod = Array.Find(subClass.GetMethods(AccessTools.allDeclared), m => m.GetBaseDefinition() == method.GetBaseDefinition());
var overridingMethod = Array.Find(subClass.GetMethods(AccessTools.allDeclared),
m => m.GetBaseDefinition() == method.GetBaseDefinition());
if (overridingMethod is null || overridingMethod.IsAbstract)
continue;
@@ -443,7 +536,8 @@ public static class AnalyzerFixes
}
}
private static IEnumerable<MethodInfo> ParseTypeMethods(string str) => Utility_GetTypeMethods(AccessTools.TypeByName(str), false);
private static IEnumerable<MethodInfo> ParseTypeMethods(string str)
=> Utility_GetTypeMethods(AccessTools.TypeByName(str), false);
private static IEnumerable<MethodInfo> ParseNestedTypeMethods(string str)
{