Skip to content

Commit

Permalink
Readability.
Browse files Browse the repository at this point in the history
  • Loading branch information
oscbyspro committed Apr 4, 2022
1 parent 3047eb7 commit d6be972
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Sources/DiffableTextKit/Models/Field.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ extension Field {
//=--------------------------------------=
// MARK: Single
//=--------------------------------------=
let upperBound = layout.index(at: destination.upperBound, start: selection.upperBound)
let upperBound = layout.index(at: destination.upperBound, from: selection.upperBound)
var lowerBound = upperBound
//=--------------------------------------=
// MARK: Double
//=--------------------------------------=
if !destination.isEmpty {
lowerBound = layout.index(at: destination.lowerBound, start: selection.lowerBound)
lowerBound = layout.index(at: destination.lowerBound, from: selection.lowerBound)
}
//=--------------------------------------=
// MARK: Return
Expand Down
2 changes: 1 addition & 1 deletion Sources/DiffableTextKit/Models/Layout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ extension Layout {
// MARK: Position
//=------------------------------------------------------------------------=

@inlinable func index(at position: Position, start: Index) -> Index {
@inlinable func index(at position: Position, from start: Index) -> Index {
switch start.position <= position {
case true: return index(after: start, while: { $0.position < position })
case false: return index(before: start, while: { $0.position > position })
Expand Down
4 changes: 2 additions & 2 deletions Sources/DiffableTextKit/Models/Position.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public struct Position<Scheme: DiffableTextKit.Scheme>: Comparable, ExpressibleB
// MARK: Transformations
//=------------------------------------------------------------------------=

@inlinable func after(_ character: Character) -> Self {
Self(offset + Scheme.size(of: character))
@inlinable func after(_ character: Character) -> Self {
Self(offset + Scheme.size(of: character))
}

@inlinable func before(_ character: Character) -> Self {
Expand Down

0 comments on commit d6be972

Please sign in to comment.