Skip to content

Commit 7fc1510

Browse files
Fix DictionaryLiteral equality implementation
1 parent 471013e commit 7fc1510

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

stdlib/public/core/Mirror.swift

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -908,20 +908,11 @@ extension DictionaryLiteral : RandomAccessCollection {
908908
extension DictionaryLiteral : Equatable where Key: Equatable, Value : Equatable {
909909
@_inlineable // FIXME(sil-serialize-all)
910910
public static func ==(lhs: DictionaryLiteral<Key, Value>, rhs: DictionaryLiteral<Key, Value>) -> Bool {
911-
let lhsCount = lhs.count
912-
if lhsCount != rhs.count {
911+
if lhs.count != rhs.count {
913912
return false
914913
}
915914

916915
return lhs.elementsEqual(rhs)
917-
// We know that lhs.count == rhs.count, compare element wise.
918-
for idx in 0..<lhsCount {
919-
if lhs[idx].key != rhs[idx].key ||
920-
lhs[idx].value != rhs[idx].value {
921-
return false
922-
}
923-
}
924-
return true
925916
}
926917
}
927918

0 commit comments

Comments
 (0)