Remove double dict access when adding object property
This commit is contained in:
parent
466b7a4c0b
commit
ef95b07926
|
@ -79,11 +79,12 @@ public class ObjectHierarchy
|
|||
foreach (var prop in chunk.properties)
|
||||
{
|
||||
var id = prop.objectId;
|
||||
if (!_objects.ContainsKey(id))
|
||||
if (!_objects.TryGetValue(id, out var value))
|
||||
{
|
||||
_objects.Add(id, new DarkObject(id));
|
||||
value = new DarkObject(id);
|
||||
_objects.Add(id, value);
|
||||
}
|
||||
_objects[id].properties.TryAdd(name, prop);
|
||||
value.properties.TryAdd(name, prop);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue