Skip to content

Commit bf3030f

Browse files
committed
Update OutlineViewDiffableDataSourceSnapshot.swift
1 parent 4923b61 commit bf3030f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/AdvancedCollectionTableView/DiffableDataSource/NSOutlineView/Snapshot/OutlineViewDiffableDataSourceSnapshot.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,11 @@ public struct OutlineViewDiffableDataSourceSnapshot<ItemIdentifierType: Hashable
147147
validateItems(snapshot.items)
148148
if let rootIndex = rootItems.firstIndex(of: item) {
149149
rootItems.insert(contentsOf: snapshot.rootItems, at: before ? rootIndex : rootIndex + 1)
150-
nodes.merge(snapshot.nodes)
150+
nodes.merge(with: snapshot.nodes)
151151
} else if let parentItem = parent(of: item),
152152
let childIndex = nodes[parentItem]?.children.firstIndex(of: item) {
153153
nodes[parentItem]?.children.insert(contentsOf: snapshot.rootItems, at: before ? childIndex : childIndex + 1)
154-
nodes.merge(snapshot.nodes)
154+
nodes.merge(with: snapshot.nodes)
155155
snapshot.rootItems.forEach({ nodes[$0]?.parent = parentItem })
156156
}
157157
updateOrderedItems()
@@ -307,7 +307,7 @@ public struct OutlineViewDiffableDataSourceSnapshot<ItemIdentifierType: Hashable
307307
guard let previousChildren = nodes[parent]?.children else { return }
308308
previousChildren.forEach({ deleteItemAndDescendants($0) })
309309
nodes[parent]?.children = snapshot.rootItems
310-
nodes.merge(snapshot.nodes)
310+
nodes.merge(with: snapshot.nodes)
311311
snapshot.rootItems.forEach({ nodes[$0]?.parent = parent })
312312
updateOrderedItems()
313313
}

0 commit comments

Comments
 (0)