File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,26 @@ public protocol CxxDictionary<Key, Value> {
42
42
/// Do not implement this function manually in Swift.
43
43
func __endUnsafe( ) -> RawIterator
44
44
45
+ < <<<<<< HEAD
45
46
/// Do not implement this function manually in Swift.
46
47
mutating func __endMutatingUnsafe( ) -> RawMutableIterator
48
+ =======
49
+ func filter(
50
+ _ isIncluded: ( Key , Value ) throws -> Bool
51
+ ) rethrows -> [ Key : Value ] {
52
+ var filteredDictionary : [ Key : Value ] = [ : ]
53
+ let iterator = __findUnsafe ( Key)
54
+ let endIterator = __endUnsafe ( )
55
+
56
+ while iterator != endIterator {
57
+ let pair = iterator. pointee
58
+ if try isIncluded ( pair. first, pair. second) {
59
+ filteredDictionary [ pair. first] = pair. second
60
+ }
61
+ iterator. successor ( )
62
+ }
63
+ }
64
+ > >>>>>> 2 dccec95 be3 ( Add filter method for ordered and unordered map)
47
65
}
48
66
49
67
extension CxxDictionary {
You can’t perform that action at this time.
0 commit comments