Skip to content

Commit 6a74e0f

Browse files
authored
Remove superfluous updates from BasicDataSource when moving items (#9)
1 parent 0732c15 commit 6a74e0f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Sources/BasicData/BasicDataSource.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ public class BasicDataSource<Section>: DataSourceType where Section: SectionType
3434
}
3535

3636
public func moveItem(at sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath) {
37+
var sections = self.sections
3738
let item = sections[sourceIndexPath.section].items[sourceIndexPath.item]
3839
sections[sourceIndexPath.section].items.remove(at: sourceIndexPath.item)
3940
sections[destinationIndexPath.section].items.insert(item, at: destinationIndexPath.item)
41+
self.sections = sections
4042
}
4143
}

0 commit comments

Comments
 (0)