-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
[ { "a": 1, "z": 1 }, { "a": 2, "z": 2 } ]
[ { "a": 2, "z": 2 }, { "z": 1, "a": 1 } ]
The example above is two arrays of equal objects. These arrays cannot be matched effectively using any ArrayComparisonMode.
- Strict: Arrays are considered unequal, because the order of objects is different.
- Unordered: Arrays are sorted using string representation of object as the sorting key. Field order in equal objects is different. Arrays are considered unequal because of that.
- Permutation-based: The example contains only 2 objects in each array to be human readable. Unfortunately, permutation based comparison cannot be used on arrays containing 10 or more elements, because number of possible permutations is n! (n factorial).
Proposed solution: optimize sorting in "unordered" comparison mode, so that string representations of two equal objects are equal strings.