Commit 0460763
authored
Fix ordered set comparison check (#2082)
For some reason, using `memcmp` with an empty ordered set and a
non-empty ordered set returns true:
```swift
areOrderedSetsDuplicates([1, 2, 3], []) // true
```
Because of this, we should always check the count before delegating to
`memcmp`. We should also be on the lookout for other exceptions in case
`memcmp` is not appropriate to use here.1 parent 8330f53 commit 0460763
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
| |||
0 commit comments