Skip to content

Commit

Permalink
Merge pull request #107 from Shopify/changeset-class
Browse files Browse the repository at this point in the history
Change changeset to class
  • Loading branch information
krbarnes authored Aug 15, 2018
2 parents 80b6e3b + 08fbd77 commit 5a06c2f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion FunctionalTableData/HostCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public struct HostCell<View, State, Layout>: CellConfigType where View: UIView,
cellUpdater(cell.view, state)
}

@inline(never)
public func isEqual(_ other: CellConfigType) -> Bool {
if let other = other as? HostCell<View, State, Layout> {
return state == other.state
Expand Down
6 changes: 3 additions & 3 deletions FunctionalTableData/TableSectionChangeSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct Moved<T: Equatable>: Equatable {

// Compares two arrays of TableSections and produces the operations
// required to go from one to the other
public struct TableSectionChangeSet {
public final class TableSectionChangeSet {
typealias MovedSection = Moved<Int>
typealias MovedRow = Moved<IndexPath>

Expand Down Expand Up @@ -102,7 +102,7 @@ public struct TableSectionChangeSet {
*
* Whenever a section was also in the previous list, we compare the sections and perform the exact same algorithm on the individual rows.
*/
private mutating func calculateChanges() {
private func calculateChanges() {
let newSections = Set(new.map { $0.key })
var oldSections: [String: Int] = Dictionary(minimumCapacity: old.count)
for (oldSectionIndex, oldSection) in old.enumerated() {
Expand Down Expand Up @@ -167,7 +167,7 @@ public struct TableSectionChangeSet {
return new.section.mergedStyle(for: new.row) == old.section.mergedStyle(for: old.row)
}

private mutating func compareRows(newRows: inout Set<String>, oldRows: inout [String: Int], oldSectionIndex: Int, newSectionIndex: Int) {
private func compareRows(newRows: inout Set<String>, oldRows: inout [String: Int], oldSectionIndex: Int, newSectionIndex: Int) {
// Clear the set and dictionary, ensuring we keep the capacity to reduce allocations
newRows.removeAll(keepingCapacity: true)
oldRows.removeAll(keepingCapacity: true)
Expand Down

0 comments on commit 5a06c2f

Please sign in to comment.