ryanflach (Ryan Flach)
- Login: ryanflach
- Registered on: 07/25/2019
- Last sign in: 07/25/2019
Issues
| open | closed | Total | |
|---|---|---|---|
| Assigned issues | 0 | 0 | 0 |
| Reported issues | 0 | 1 | 1 |
Activity
07/26/2019
-
12:39 AM Ruby Bug #16022: Enumerable#sort_by returns a swapped first and last element when the sort value is identical and collection is >= 8 elements
- jeremyevans0 (Jeremy Evans) wrote:
> The current behavior is expected and documented: `The result is not guaranteed to be stable. When two keys are equal, the order of the corresponding elements is unpredictable.`
> ...
Jeremy,
Than...
07/25/2019
-
10:38 PM Ruby Bug #16022 (Rejected): Enumerable#sort_by returns a swapped first and last element when the sort value is identical and collection is >= 8 elements
- **Overview**
I've seen in the source code that the ordering may be unpredictable (https://github.com/ruby/ruby/blob/515e106fb73a1a3bc69b6f1670bbaaebf45fee30/enum.c#L1159-L1160), but it seems to consistently swap the first and last eleme...