Skip to content

Commit 7d0ac1f

Browse files
committed
Merge remote-tracking branch 'origin/master' into swift-5.1-branch
2 parents 3d8f93c + 51c6f47 commit 7d0ac1f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Foundation/NSCFDictionary.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,11 @@ internal func _CFSwiftDictionaryGetCountOfValue(_ dictionary: AnyObject, value:
147147
}
148148

149149
internal func _CFSwiftDictionaryContainsValue(_ dictionary: AnyObject, value: AnyObject) -> Bool {
150-
NSUnimplemented()
150+
if let value = value as? AnyHashable {
151+
return (dictionary as! NSDictionary).allValues.lazy.compactMap { $0 as? AnyHashable }.contains(value)
152+
} else {
153+
return false
154+
}
151155
}
152156

153157
// HAZARD! WARNING!

0 commit comments

Comments
 (0)