clear warnings

This commit is contained in:
John Estropia
2020-11-11 13:18:11 +09:00
parent d6eae8c091
commit 63b3d25d78
11 changed files with 83 additions and 17 deletions

View File

@@ -597,20 +597,32 @@ public struct ListSnapshot<O: DynamicObject>: RandomAccessCollection, Hashable {
self.diffableSnapshot.reloadSections(sectionIDs)
}
// MARK: RandomAccessCollection
public var startIndex: Index {
return self.diffableSnapshot.itemIdentifiers.startIndex
return 0
}
public var endIndex: Index {
return self.diffableSnapshot.itemIdentifiers.endIndex
return self.diffableSnapshot.numberOfItems
}
// MARK: BidirectionalCollection
public func index(_ i: Int, offsetBy distance: Int) -> Int {
return i + distance
}
public func distance(from start: Int, to end: Int) -> Int {
return end - start
}
// MARK: Sequence