Implement a Merge function on IDLists which is more efficient than repeated Add

This commit is contained in:
Bryan Boreham
2015-07-07 21:59:39 +01:00
parent 76d658b193
commit baf0d94af9
4 changed files with 32 additions and 4 deletions

View File

@@ -53,8 +53,8 @@ func (rn *RenderableNode) Merge(other RenderableNode) {
panic(rn.ID)
}
rn.Adjacency = rn.Adjacency.Add(other.Adjacency...)
rn.Origins = rn.Origins.Add(other.Origins...)
rn.Adjacency = rn.Adjacency.Merge(other.Adjacency)
rn.Origins = rn.Origins.Merge(other.Origins)
rn.AggregateMetadata.Merge(other.AggregateMetadata)
rn.NodeMetadata.Merge(other.NodeMetadata)