Skip to content

Commit 3047eb7

Browse files
committed
Cleanup: marks.
1 parent 3c67ef3 commit 3047eb7

File tree

3 files changed

+13
-17
lines changed

3 files changed

+13
-17
lines changed

Sources/DiffableTextKit/Models/Layout.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,19 +222,19 @@ extension Layout {
222222
//=--------------------------------------=
223223
let direction = direction ?? preference
224224
//=--------------------------------------=
225-
// MARK: Try In This Direction
225+
// MARK: Search In This Direction
226226
//=--------------------------------------=
227227
if let position = caret(from: start, towards: direction, through: direction != preference) {
228228
return position
229229
}
230230
//=--------------------------------------=
231-
// MARK: Try In The Other Direction
231+
// MARK: Search In The Opposite Direction
232232
//=--------------------------------------=
233233
if let position = caret(from: start, towards: direction.reversed(), through: false) {
234234
return position
235235
}
236236
//=--------------------------------------=
237-
// MARK: Return Instance Start Index
237+
// MARK: Return Layout Start Index
238238
//=--------------------------------------=
239239
return self.startIndex
240240
}
@@ -266,7 +266,7 @@ extension Layout {
266266
formIndex(after: &position)
267267
}
268268
//=--------------------------------------=
269-
// MARK: Failure == None
269+
// MARK: Absent
270270
//=--------------------------------------=
271271
return nil
272272
}
@@ -293,7 +293,7 @@ extension Layout {
293293
if predicate(position) { return position }
294294
}
295295
//=--------------------------------------=
296-
// MARK: Failure == None
296+
// MARK: Absent
297297
//=--------------------------------------=
298298
return nil
299299
}

Sources/DiffableTextKit/Support/Index.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public extension Collection {
2727
formIndex(after: &position)
2828
}
2929
//=--------------------------------------=
30-
// MARK: Position == End Index
30+
// MARK: Return End Index
3131
//=--------------------------------------=
3232
return position
3333
}
@@ -53,7 +53,7 @@ public extension BidirectionalCollection {
5353
formIndex(before: &position)
5454
}
5555
//=--------------------------------------=
56-
// MARK: Position == Start Index
56+
// MARK: Return Start Index
5757
//=--------------------------------------=
5858
return position
5959
}

Sources/DiffableTextKit/Support/Suffix.swift

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,28 @@
1111
// MARK: * BidirectionalCollection - Suffix
1212
//*============================================================================*
1313

14-
public extension BidirectionalCollection {
14+
extension BidirectionalCollection {
1515

1616
//=------------------------------------------------------------------------=
1717
// MARK: While
1818
//=------------------------------------------------------------------------=
1919

20-
@inlinable func suffix(while predicate: (Element) throws -> Bool) rethrows -> SubSequence {
20+
@inlinable public func suffix(while predicate: (Element) throws -> Bool) rethrows -> SubSequence {
2121
try self[startOfSuffix(while: predicate)...]
2222
}
23-
24-
//=------------------------------------------------------------------------=
25-
// MARK: While - Start
26-
//=------------------------------------------------------------------------=
27-
28-
@inlinable internal func startOfSuffix(while predicate: (Element) throws -> Bool) rethrows -> Index {
23+
24+
@inlinable func startOfSuffix(while predicate: (Element) throws -> Bool) rethrows -> Index {
2925
var position = endIndex
3026
//=--------------------------------------=
31-
// MARK: Loop
27+
// MARK: Search
3228
//=--------------------------------------=
3329
while position != startIndex {
3430
let after = position
3531
formIndex(before: &position)
3632
if try !predicate(self[position]) { return after }
3733
}
3834
//=--------------------------------------=
39-
// MARK: Position == Start Index
35+
// MARK: Return Start Index
4036
//=--------------------------------------=
4137
return position
4238
}

0 commit comments

Comments
 (0)