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
@@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Lint
|
||||
{
|
||||
foreach (var traitInfo in actorInfo.Value.TraitInfos<TraitInfo>())
|
||||
{
|
||||
var fields = traitInfo.GetType().GetFields().Where(f => f.HasAttribute<LocomotorReferenceAttribute>());
|
||||
var fields = Utility.GetFields(traitInfo.GetType()).Where(f => Utility.HasAttribute<LocomotorReferenceAttribute>(f));
|
||||
foreach (var field in fields)
|
||||
{
|
||||
var locomotors = LintExts.GetFieldValues(traitInfo, field);
|
||||
|
||||
Reference in New Issue
Block a user