Why is it `Belt.SortArray.stableSortBy` instead of `Belt.Array.sort`?

I wonder why there is Belt.SortArray.stableSortBy instead of simply Belt.Array.sort similar to Belt.List.sort

reference How do I sort Array? - #4 by imjoshellis

3 Likes

IIRC, this is due to historic reasons.
The stableSort is used by the map, when we cut the size as small as possible.

2 Likes