Skip to content

Commit 4c72bd9

Browse files
author
Tim Vermeulen
committed
Rename endsOfCommonPrefix -> endOfCommonPrefix, startsOfCommonSuffix -> startOfCommonSuffix
1 parent 4f3525e commit 4c72bd9

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Sources/Algorithms/CommonPrefix.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ extension BidirectionalCollection {
261261
with other: Other,
262262
by areEquivalent: (Element, Other.Element) throws -> Bool
263263
) rethrows -> SubSequence {
264-
let (index, _) = try startsOfCommonSuffix(with: other, by: areEquivalent)
264+
let (index, _) = try startOfCommonSuffix(with: other, by: areEquivalent)
265265
return self[index...]
266266
}
267267
}
@@ -276,12 +276,12 @@ extension BidirectionalCollection where Element: Equatable {
276276
}
277277

278278
//===----------------------------------------------------------------------===//
279-
// Collection.endsOfCommonPrefix(with:)
279+
// Collection.endOfCommonPrefix(with:)
280280
//===----------------------------------------------------------------------===//
281281

282282
extension Collection {
283283
@inlinable
284-
public func endsOfCommonPrefix<Other: Collection>(
284+
public func endOfCommonPrefix<Other: Collection>(
285285
with other: Other,
286286
by areEquivalent: (Element, Other.Element) throws -> Bool
287287
) rethrows -> (Index, Other.Index) {
@@ -301,20 +301,20 @@ extension Collection {
301301

302302
extension Collection where Element: Equatable {
303303
@inlinable
304-
public func endsOfCommonPrefix<Other: Collection>(
304+
public func endOfCommonPrefix<Other: Collection>(
305305
with other: Other
306306
) -> (Index, Other.Index) where Other.Element == Element {
307-
endsOfCommonPrefix(with: other, by: ==)
307+
endOfCommonPrefix(with: other, by: ==)
308308
}
309309
}
310310

311311
//===----------------------------------------------------------------------===//
312-
// BidirectionalCollection.startsOfCommonPrefix(with:)
312+
// BidirectionalCollection.startOfCommonPrefix(with:)
313313
//===----------------------------------------------------------------------===//
314314

315315
extension BidirectionalCollection {
316316
@inlinable
317-
public func startsOfCommonSuffix<Other: BidirectionalCollection>(
317+
public func startOfCommonSuffix<Other: BidirectionalCollection>(
318318
with other: Other,
319319
by areEquivalent: (Element, Other.Element) throws -> Bool
320320
) rethrows -> (Index, Other.Index) {
@@ -342,9 +342,9 @@ extension BidirectionalCollection {
342342

343343
extension BidirectionalCollection where Element: Equatable {
344344
@inlinable
345-
public func startsOfCommonSuffix<Other: BidirectionalCollection>(
345+
public func startOfCommonSuffix<Other: BidirectionalCollection>(
346346
with other: Other
347347
) -> (Index, Other.Index) where Other.Element == Element {
348-
startsOfCommonSuffix(with: other, by: ==)
348+
startOfCommonSuffix(with: other, by: ==)
349349
}
350350
}

0 commit comments

Comments
 (0)