Skip to content

Commit

Permalink
Refactor and document sorting dispatch (#47383)
Browse files Browse the repository at this point in the history
* create an internal `_sort!` function and use it (rename the existing `_sort!` to `__sort!`)

* test for several of bugs that slipped through test suite

* Give each sorting pass and DEFAULT_STABLE a docstring

* add pretty printing for the new algorithms that are much more flexible than the old ones

* fix unexpected allocations in Radix Sort

fixes #47474
in this PR rather than separate to avoid dealing with the merge

* support and test backwards compatibility with packages that depend in sorting internals

* support 3-, 5-, and 6-argument sort! for backwards compatibility

* overhall scratch space handling

make _sort! return scratch space rather than sorted vector
so that things like IEEEFloatOptimization can re-use the
scratch space allocated on their first recursive call

* test handling -0.0 in IEEEFloatOptimization

* fix and test bug where countsort's correct overflow behavior triggers error due to unexpected promotion to UInt
  • Loading branch information
LilithHafner authored Dec 3, 2022
1 parent 2a0eb70 commit cee0a04
Show file tree
Hide file tree
Showing 2 changed files with 968 additions and 490 deletions.
Loading

0 comments on commit cee0a04

Please sign in to comment.