Skip to content

Commit 7e111d7

Browse files
committed
Fixes test extensions.
1 parent af696ea commit 7e111d7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Tests/RxDataSourcesTests/ChangeSet+TestExtensions.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ extension Changeset {
8686

8787
extension Changeset {
8888

89-
fileprivate func apply(original: [S]) -> [S] {
89+
fileprivate func apply(original: [Section]) -> [Section] {
9090

9191
let afterDeletesAndUpdates = applyDeletesAndUpdates(original: original)
9292
let afterSectionMovesAndInserts = applySectionMovesAndInserts(original: afterDeletesAndUpdates)
@@ -95,8 +95,8 @@ extension Changeset {
9595
return afterItemInsertsAndMoves
9696
}
9797

98-
private func applyDeletesAndUpdates(original: [S]) -> [S] {
99-
var resultAfterDeletesAndUpdates: [SectionModelTypeWrapper<S>] = SectionModelTypeWrapper.wrap(original)
98+
private func applyDeletesAndUpdates(original: [Section]) -> [Section] {
99+
var resultAfterDeletesAndUpdates: [SectionModelTypeWrapper<Section>] = SectionModelTypeWrapper.wrap(original)
100100

101101
for index in updatedItems {
102102
resultAfterDeletesAndUpdates[index.sectionIndex].items[index.itemIndex].updated = true
@@ -124,7 +124,7 @@ extension Changeset {
124124
return SectionModelTypeWrapper.unwrap(resultAfterDeletesAndUpdates)
125125
}
126126

127-
private func applySectionMovesAndInserts(original: [S]) -> [S] {
127+
private func applySectionMovesAndInserts(original: [Section]) -> [Section] {
128128
if !updatedSections.isEmpty {
129129
fatalError("Section updates aren't supported")
130130
}
@@ -149,7 +149,7 @@ extension Changeset {
149149

150150
let totalCount = original.count + insertedSections.count
151151

152-
var results: [S] = []
152+
var results: [Section] = []
153153

154154
for index in 0 ..< totalCount {
155155
if insertedSectionsIndexes.contains(index) {
@@ -170,8 +170,8 @@ extension Changeset {
170170
return results
171171
}
172172

173-
private func applyItemInsertsAndMoves(original: [S]) -> [S] {
174-
var resultAfterInsertsAndMoves: [S] = original
173+
private func applyItemInsertsAndMoves(original: [Section]) -> [Section] {
174+
var resultAfterInsertsAndMoves: [Section] = original
175175

176176
let sourceIndexesThatShouldBeMoved = Set(movedItems.map { $0.from })
177177
let destinationToSourceMapping = Dictionary(elements: self.movedItems, keySelector: { $0.to }, valueSelector: { $0.from })
@@ -210,7 +210,7 @@ extension Changeset {
210210
+ movedInSection[sectionIndex]
211211
- movedOutSection[sectionIndex]
212212

213-
var resultItems: [S.Item] = []
213+
var resultItems: [Section.Item] = []
214214

215215
for index in 0 ..< totalCount {
216216
let itemPath = ItemPath(sectionIndex: sectionIndex, itemIndex: index)
@@ -229,7 +229,7 @@ extension Changeset {
229229
}
230230
}
231231

232-
resultAfterInsertsAndMoves[sectionIndex] = S(original: section, items: resultItems)
232+
resultAfterInsertsAndMoves[sectionIndex] = Section(original: section, items: resultItems)
233233
}
234234

235235
return resultAfterInsertsAndMoves

0 commit comments

Comments
 (0)