Skip to content

Commit 51c6f47

Browse files
authored
Merge pull request #2445 from millenomi/nsdictionary-cfswiftdictionarycontainsvalue
2 parents d1e05c6 + daf3561 commit 51c6f47

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)