Skip to content

Commit

Permalink
Fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ra1028 committed May 7, 2019
1 parent 4c73612 commit ff71a38
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Sources/Algorithm.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@ public extension StagedChangeset where Collection: RangeReplaceableCollection, C
let sourceElements = ContiguousArray(source)
let targetElements = ContiguousArray(target)

// Returns the empty changesets if both are empty.
// Return empty changesets if both are empty.
if sourceElements.isEmpty && targetElements.isEmpty {
self.init()
return
}

// Returns the changesets that all deletions if source is not empty and target is empty.
// Return changesets that all deletions if source is not empty and target is empty.
if !sourceElements.isEmpty && targetElements.isEmpty {
self.init([Changeset(data: target, elementDeleted: sourceElements.indices.map { ElementPath(element: $0, section: section) })])
return
}

// Returns the changesets that all insertions if source is empty and target is not empty.
// Return changesets that all insertions if source is empty and target is not empty.
if sourceElements.isEmpty && !targetElements.isEmpty {
self.init([Changeset(data: target, elementInserted: targetElements.indices.map { ElementPath(element: $0, section: section) })])
return
Expand Down Expand Up @@ -234,7 +234,7 @@ public extension StagedChangeset where Collection: RangeReplaceableCollection, C
}
}

// Track an target and source indices of the elements having same identifier.
// Track target and source indices of the elements having same identifier.
for targetSectionIndex in contiguousTargetSections.indices {
let targetElements = contiguousTargetSections[targetSectionIndex]

Expand Down Expand Up @@ -491,7 +491,7 @@ internal func differentiate<E: Differentiable, I>(
}
}

// Track an target and source indices of the elements having same identifier.
// Track target and source indices of the elements having same identifier.
for targetIndex in target.indices {
var targetIdentifier = target[targetIndex].differenceIdentifier
let key = TableKey(pointer: &targetIdentifier)
Expand Down

0 comments on commit ff71a38

Please sign in to comment.