Skip to content

Commit 822fec7

Browse files
committed
[stdlib] Make new Dict filter closure type match sequence
1 parent bdcf640 commit 822fec7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

stdlib/public/core/HashedCollections.swift.gyb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2012,12 +2012,12 @@ public struct Dictionary<Key : Hashable, Value> :
20122012
@_inlineable
20132013
@available(swift, introduced: 4.0)
20142014
public func filter(
2015-
_ isIncluded: (Key, Value) throws -> Bool
2015+
_ isIncluded: (Element) throws -> Bool
20162016
) rethrows -> [Key: Value] {
20172017
var result = Dictionary()
2018-
for (key, value) in self {
2019-
if try isIncluded(key, value) {
2020-
result[key] = value
2018+
for el in self {
2019+
if try isIncluded(el) {
2020+
result[el.key] = el.value
20212021
}
20222022
}
20232023
return result

0 commit comments

Comments
 (0)