Skip to content

Commit b420685

Browse files
author
mkandil
committed
add return self and init
1 parent cfe368e commit b420685

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

stdlib/public/Cxx/CxxDictionary.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ public protocol CxxDictionary<Key, Value> {
2525
associatedtype Size: BinaryInteger
2626
associatedtype InsertionResult
2727

28+
init()
29+
2830
/// Do not implement this function manually in Swift.
2931
func __findUnsafe(_ key: Key) -> RawIterator
3032

@@ -76,10 +78,10 @@ extension CxxDictionary {
7678
}
7779
}
7880

79-
func filter(
81+
public func filter(
8082
_ isIncluded: (_ key: Key, _ value: Value) throws -> Bool
81-
) rethrows -> [Key: Value] {
82-
var filteredDictionary: [Key: Value] = [:]
83+
) rethrows -> Self {
84+
var filteredDictionary: Self.init()
8385
var iterator = __beginUnsafe()
8486
let endIterator = __endUnsafe()
8587

0 commit comments

Comments
 (0)