Optimize GC for enumeration in context cascade insertion.

This commit is contained in:
2023-03-24 20:58:45 +08:00
parent e03dbef5ff
commit bde6216295
2 changed files with 3 additions and 3 deletions

View File

@@ -126,7 +126,7 @@ namespace Cryville.Crtr {
public void ContextCascadeInsert() {
ContextCascade[_cascadeHeight++].Clear();
}
public void ContextCascadeInsert(IReadOnlyDictionary<int, PropSrc> srcs) {
public void ContextCascadeInsert(IntKeyedDictionary<PropSrc> srcs) {
ContextCascadeInsert();
foreach (var src in srcs) ContextCascadeUpdate(src.Key, src.Value);
}

View File

@@ -168,8 +168,8 @@ namespace Cryville.Crtr {
}
public class SkinContext {
public Transform Transform { get; private set; }
public IReadOnlyDictionary<int, PropSrc> PropSrcs { get; private set; }
public SkinContext(Transform transform, IReadOnlyDictionary<int, PropSrc> propSrcs = null) {
public IntKeyedDictionary<PropSrc> PropSrcs { get; private set; }
public SkinContext(Transform transform, IntKeyedDictionary<PropSrc> propSrcs = null) {
Transform = transform;
PropSrcs = propSrcs;
}