Skip to content

Commit 0ef0e7f

Browse files
committed
Actually make use of optimization
1 parent 8c1a53e commit 0ef0e7f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Runtime/SassyPatching/Execution/Universe.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using SassyPatchGrammar;
99
using System.Reflection;
1010
using JetBrains.Annotations;
11+
using PatchManager.Generic.SassyPatching.Rulesets;
1112
using PatchManager.SassyPatching.Exceptions;
1213
using PatchManager.SassyPatching.NewAssets;
1314
using PatchManager.SassyPatching.Nodes.Expressions;
@@ -552,7 +553,18 @@ public static void RegisterRawLibrary(string modId, string name, string raw)
552553
private void RegisterPatcher(SassyTextPatcher patcher)
553554
{
554555
TotalPatchCount += 1;
555-
if (patcher.RuleSet.Labels == null && patcher.AssetName == null)
556+
if (patcher.RuleSet is JsonRuleset && patcher.AssetType != null)
557+
{
558+
if (LabelPatches.TryGetValue(patcher.AssetType, out var patchers))
559+
{
560+
AddSorted(patchers, patcher);
561+
}
562+
else
563+
{
564+
LabelPatches[patcher.AssetType] = new List<SassyTextPatcher> {patcher};
565+
}
566+
}
567+
else if (patcher.RuleSet.Labels == null && patcher.AssetName == null)
556568
{
557569
AddSorted(GenericPatches, patcher);
558570
} else if (patcher.RuleSet.Labels != null && patcher.AssetName == null)

0 commit comments

Comments
 (0)