Optimize MatchDynamic performance.
This commit is contained in:
@@ -60,15 +60,18 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void MatchDynamic(ContainerState context) {
|
public void MatchDynamic(ContainerState context) {
|
||||||
|
if (dynprops.Count == 0 && dynelems.Count == 0) return;
|
||||||
Profiler.BeginSample("SkinContainer.MatchDynamic");
|
Profiler.BeginSample("SkinContainer.MatchDynamic");
|
||||||
ChartPlayer.etor.ContextState = context;
|
ChartPlayer.etor.ContextState = context;
|
||||||
ChartPlayer.etor.ContextEvent = context.Container;
|
ChartPlayer.etor.ContextEvent = context.Container;
|
||||||
foreach (var p in dynprops) {
|
for (int i = 0; i < dynprops.Count; i++) {
|
||||||
|
DynamicProperty p = dynprops[i];
|
||||||
var prop = GetPropOp(p.Anchor, p.Key);
|
var prop = GetPropOp(p.Anchor, p.Key);
|
||||||
if (context.CloneType > prop.UpdateCloneType) continue;
|
if (context.CloneType > prop.UpdateCloneType) continue;
|
||||||
ChartPlayer.etor.Evaluate(prop.Operator, p.Value);
|
ChartPlayer.etor.Evaluate(prop.Operator, p.Value);
|
||||||
}
|
}
|
||||||
foreach (var e in dynelems) {
|
for (int i = 0; i < dynelems.Count; i++) {
|
||||||
|
DynamicElement e = dynelems[i];
|
||||||
var anchor = e.Selectors.MatchDynamic(context, e.Anchor);
|
var anchor = e.Selectors.MatchDynamic(context, e.Anchor);
|
||||||
if (anchor != null) MatchDynamic(e.Element, context, anchor);
|
if (anchor != null) MatchDynamic(e.Element, context, anchor);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user