8000 Silence nearly matching warning for SortedArray.filter · ole/SortedArray@b6e3385 · GitHub
[go: up one dir, main page]

Skip to content

Commit b6e3385

Browse files
klaaspieterole
authored andcommitted
Silence nearly matching warning for SortedArray.filter
Swift 4.2 warns that the SortedArray returning version of filter nearly matches the one required by Sequence. The warning also helpfully tells us to move it to another extension.
1 parent a9104b3 commit b6e3385

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Sources/SortedArray.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ extension SortedArray: RandomAccessCollection {
9999
public subscript(position: Index) -> Element {
100100
return _elements[position]
101101
}
102+
}
102103

104+
extension SortedArray {
103105
/// Like `Sequence.filter(_:)`, but returns a `SortedArray` instead of an `Array`.
104106
/// We can do this efficiently because filtering doesn't change the sort order.
105107
public func filter(_ isIncluded: (Element) throws -> Bool) rethrows -> SortedArray<Element> {

0 commit comments

Comments
 (0)
0