Make the return type of CountedSet's subscript non-optional

This commit is contained in:
Nate Weaver 2020-04-30 04:33:15 -05:00
parent 62737bd94f
commit f38406e3ac
1 changed files with 2 additions and 2 deletions

View File

@ -300,9 +300,9 @@ private struct CountedSet<Element> where Element: Hashable {
return _storage[element] != nil
}
subscript(key: Element) -> Int? {
subscript(key: Element) -> Int {
get {
return _storage[key]
return _storage[key, default: 0]
}
}
}