Skip to content

Commit 49d9ae4

Browse files
authored
SWIFT-1086 Update sortedEquals impl to use equalsIgnoreKeyOrder (#598)
1 parent 41f078b commit 49d9ae4

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

Package.resolved

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/TestsCommon/CommonTestUtils.swift

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -271,15 +271,7 @@ public protocol SortedEquatable {
271271

272272
extension BSONDocument: SortedEquatable {
273273
public func sortedEquals(_ other: BSONDocument) -> Bool {
274-
guard self.buffer.readableBytes == other.buffer.readableBytes else {
275-
return false
276-
}
277-
for (k, v) in self {
278-
guard let otherValue = other[k], v.sortedEquals(otherValue) else {
279-
return false
280-
}
281-
}
282-
return true
274+
self.equalsIgnoreKeyOrder(other)
283275
}
284276
}
285277

0 commit comments

Comments
 (0)