Introduce IntKeyedDictionary
to improve performance.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Cryville.Common;
|
||||
using Cryville.Common.Collections.Specialized;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -142,19 +143,19 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public Dictionary<int, PropSrc> PropSrcs { get; private set; }
|
||||
public IntKeyedDictionary<PropSrc> PropSrcs { get; private set; }
|
||||
protected void SubmitPropSrc(string name, PropSrc property) {
|
||||
PropSrcs.Add(IdentifierManager.SharedInstance.Request(name), property);
|
||||
}
|
||||
[JsonIgnore]
|
||||
public Dictionary<int, PropOp> PropOps { get; private set; }
|
||||
public IntKeyedDictionary<PropOp> PropOps { get; private set; }
|
||||
protected void SubmitPropOp(string name, PropOp property) {
|
||||
PropOps.Add(IdentifierManager.SharedInstance.Request(name), property);
|
||||
}
|
||||
|
||||
protected ChartEvent() {
|
||||
PropSrcs = new Dictionary<int, PropSrc>();
|
||||
PropOps = new Dictionary<int, PropOp>();
|
||||
PropSrcs = new IntKeyedDictionary<PropSrc>();
|
||||
PropOps = new IntKeyedDictionary<PropOp>();
|
||||
SubmitPropSrc("event", new PropSrc.Float(() => {
|
||||
int hash = GetHashCode();
|
||||
return Unsafe.As<int, float>(ref hash);
|
||||
|
Reference in New Issue
Block a user