Skip to content

Commit

Permalink
Rename endsOfCommonPrefix -> endOfCommonPrefix, `startsOfCommonSu…
Browse files Browse the repository at this point in the history
…ffix` -> `startOfCommonSuffix`
  • Loading branch information
Tim Vermeulen committed Jul 23, 2021
1 parent 4f3525e commit d6d9443
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Sources/Algorithms/CommonPrefix.swift
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ extension BidirectionalCollection {
with other: Other,
by areEquivalent: (Element, Other.Element) throws -> Bool
) rethrows -> SubSequence {
let (index, _) = try startsOfCommonSuffix(with: other, by: areEquivalent)
let (index, _) = try startOfCommonSuffix(with: other, by: areEquivalent)
return self[index...]
}
}
Expand All @@ -281,7 +281,7 @@ extension BidirectionalCollection where Element: Equatable {

extension Collection {
@inlinable
public func endsOfCommonPrefix<Other: Collection>(
public func endOfCommonPrefix<Other: Collection>(
with other: Other,
by areEquivalent: (Element, Other.Element) throws -> Bool
) rethrows -> (Index, Other.Index) {
Expand All @@ -301,10 +301,10 @@ extension Collection {

extension Collection where Element: Equatable {
@inlinable
public func endsOfCommonPrefix<Other: Collection>(
public func endOfCommonPrefix<Other: Collection>(
with other: Other
) -> (Index, Other.Index) where Other.Element == Element {
endsOfCommonPrefix(with: other, by: ==)
endOfCommonPrefix(with: other, by: ==)
}
}

Expand All @@ -314,7 +314,7 @@ extension Collection where Element: Equatable {

extension BidirectionalCollection {
@inlinable
public func startsOfCommonSuffix<Other: BidirectionalCollection>(
public func startOfCommonSuffix<Other: BidirectionalCollection>(
with other: Other,
by areEquivalent: (Element, Other.Element) throws -> Bool
) rethrows -> (Index, Other.Index) {
Expand Down Expand Up @@ -342,9 +342,9 @@ extension BidirectionalCollection {

extension BidirectionalCollection where Element: Equatable {
@inlinable
public func startsOfCommonSuffix<Other: BidirectionalCollection>(
public func startOfCommonSuffix<Other: BidirectionalCollection>(
with other: Other
) -> (Index, Other.Index) where Other.Element == Element {
startsOfCommonSuffix(with: other, by: ==)
startOfCommonSuffix(with: other, by: ==)
}
}

0 comments on commit d6d9443

Please sign in to comment.