Skip to content

Commit d6d9443

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

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Sources/Algorithms/CommonPrefix.swift

Lines changed: 7 additions & 7 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
}
@@ -281,7 +281,7 @@ extension BidirectionalCollection where Element: Equatable {
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,10 +301,10 @@ 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

@@ -314,7 +314,7 @@ extension Collection where Element: Equatable {
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)