mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-21 09:46:03 +08:00
reuse dynamicListPorts, as it could be created for every port with one or two allocations
This commit is contained in:
parent
5d3fa35067
commit
837ffe4ae1
@ -9,6 +9,7 @@ namespace XNode {
|
|||||||
private static PortDataCache portDataCache;
|
private static PortDataCache portDataCache;
|
||||||
private static Dictionary<System.Type, Dictionary<string, string>> formerlySerializedAsCache;
|
private static Dictionary<System.Type, Dictionary<string, string>> formerlySerializedAsCache;
|
||||||
private static Dictionary<System.Type, string> typeQualifiedNameCache;
|
private static Dictionary<System.Type, string> typeQualifiedNameCache;
|
||||||
|
private static List<NodePort> dynamicListPorts;
|
||||||
private static bool Initialized { get { return portDataCache != null; } }
|
private static bool Initialized { get { return portDataCache != null; } }
|
||||||
|
|
||||||
public static string GetTypeQualifiedName(System.Type type) {
|
public static string GetTypeQualifiedName(System.Type type) {
|
||||||
@ -32,7 +33,6 @@ namespace XNode {
|
|||||||
Dictionary<string, string> formerlySerializedAs = null;
|
Dictionary<string, string> formerlySerializedAs = null;
|
||||||
if (formerlySerializedAsCache != null) formerlySerializedAsCache.TryGetValue(nodeType, out formerlySerializedAs);
|
if (formerlySerializedAsCache != null) formerlySerializedAsCache.TryGetValue(nodeType, out formerlySerializedAs);
|
||||||
|
|
||||||
List<NodePort> dynamicListPorts = new List<NodePort>();
|
|
||||||
|
|
||||||
Dictionary<string, NodePort> staticPorts;
|
Dictionary<string, NodePort> staticPorts;
|
||||||
if (!portDataCache.TryGetValue(nodeType, out staticPorts)) {
|
if (!portDataCache.TryGetValue(nodeType, out staticPorts)) {
|
||||||
@ -103,6 +103,8 @@ namespace XNode {
|
|||||||
listPort.connectionType = backingPort.connectionType;
|
listPort.connectionType = backingPort.connectionType;
|
||||||
listPort.typeConstraint = backingPort.typeConstraint;
|
listPort.typeConstraint = backingPort.typeConstraint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dynamicListPorts.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -144,6 +146,7 @@ namespace XNode {
|
|||||||
/// <summary> Cache node types </summary>
|
/// <summary> Cache node types </summary>
|
||||||
private static void BuildCache() {
|
private static void BuildCache() {
|
||||||
portDataCache = new PortDataCache();
|
portDataCache = new PortDataCache();
|
||||||
|
dynamicListPorts = new List<NodePort>();
|
||||||
System.Type baseType = typeof(Node);
|
System.Type baseType = typeof(Node);
|
||||||
List<System.Type> nodeTypes = new List<System.Type>();
|
List<System.Type> nodeTypes = new List<System.Type>();
|
||||||
System.Reflection.Assembly[] assemblies = System.AppDomain.CurrentDomain.GetAssemblies();
|
System.Reflection.Assembly[] assemblies = System.AppDomain.CurrentDomain.GetAssemblies();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user