Cache reflection calls when running utility lints and commands.
Reduces runtime of --check-yaml command to 70% of original.
This commit is contained in:
committed by
Matthias Mailänder
parent
1a2aafa17c
commit
9dd4f938da
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Lint
|
||||
const BindingFlags Flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly;
|
||||
while (type != null)
|
||||
{
|
||||
if (((MemberInfo[])type.GetFields(Flags)).Concat(type.GetProperties(Flags)).Any(x => x.HasAttribute<SyncAttribute>()))
|
||||
if (((MemberInfo[])type.GetFields(Flags)).Concat(type.GetProperties(Flags)).Any(x => Utility.HasAttribute<SyncAttribute>(x)))
|
||||
return true;
|
||||
type = type.BaseType;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user