File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -41,11 +41,23 @@ public protocol CxxDictionary<Key, Value> {
41
41
42
42
/// Do not implement this function manually in Swift.
43
43
func __endUnsafe( ) -> RawIterator
44
+ }
44
45
45
- < <<<<<< HEAD
46
46
/// Do not implement this function manually in Swift.
47
47
mutating func __endMutatingUnsafe( ) -> RawMutableIterator
48
- =======
48
+
49
+ extension CxxDictionary {
50
+ @inlinable
51
+ public subscript( key: Key) -> Value? {
52
+ get {
53
+ let iter = __findUnsafe ( key)
54
+ guard iter != __endUnsafe ( ) else {
55
+ return nil
56
+ }
57
+ return iter. pointee. second
58
+ }
59
+ }
60
+
49
61
func filter(
50
62
_ isIncluded: ( Key , Value ) throws -> Bool
51
63
) rethrows -> [ Key : Value ] {
@@ -61,7 +73,6 @@ public protocol CxxDictionary<Key, Value> {
61
73
iterator. successor ( )
62
74
}
63
75
}
64
- > >>>>>> 2 dccec95 be3 ( Add filter method for ordered and unordered map)
65
76
}
66
77
67
78
extension CxxDictionary {
@@ -90,4 +101,4 @@ extension CxxDictionary {
90
101
}
91
102
}
92
103
}
93
- }
104
+ }
You can’t perform that action at this time.
0 commit comments