Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sorting iterators #46104

Merged
merged 27 commits into from
May 30, 2023
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c762cbd
widen sort's type signature
Jul 19, 2022
a00e018
fixup
Jul 19, 2022
d9316f8
remove broken cross-ref to Base.copymutable
Jul 19, 2022
54db6a6
Style
LilithHafner Jul 19, 2022
b046e7a
better error messages for `sort(4)` and `sort('c')`
Jul 20, 2022
8e94705
throw on string
Jul 30, 2022
15b2a02
Merge branch 'master' into sort-iter
LilithHafner Aug 11, 2022
fe2ce55
Add tests for error messages and drop iffy refference
Aug 11, 2022
e4cfffc
Update base/sort.jl
LilithHafner Sep 30, 2022
7c14f9d
Remove broken suggestion
LilithHafner Sep 30, 2022
36ff056
Throw on infinite iterator
LilithHafner Sep 30, 2022
f32de07
Merge branch 'master' into sort-iter
LilithHafner Oct 10, 2022
1280aea
Merge branch 'master' into sort-iter
LilithHafner Oct 15, 2022
d9c8a7d
Merge branch 'master' into sort-iter
LilithHafner Nov 25, 2022
449f9ff
Update compat entry to 1.10
LilithHafner Nov 25, 2022
60e42f5
Merge branch 'master' into sort-iter
LilithHafner Dec 3, 2022
55d5e7e
Merge branch 'master' into sort-iter
LilithHafner Feb 11, 2023
f5ad11a
make sort(::NTuple) return a tuple
Feb 17, 2023
55c8efe
Merge branch 'master' into sort-iter
LilithHafner Feb 17, 2023
ac32a38
Fallback to vector sorting for large tuples
Feb 17, 2023
264836d
resolve method ambiguity
Feb 18, 2023
0c53911
drop threshold to 9 and switch from home rolled split to IteratorsMD.…
Feb 18, 2023
9fc05de
Update test/sorting.jl
LilithHafner Feb 18, 2023
6a838e5
Merge branch 'master' into sort-iter
Mar 3, 2023
d42c234
support sorting AbstractStrings
Mar 3, 2023
741017e
Merge branch 'master' into sort-iter
LilithHafner Apr 21, 2023
a0d3e4d
Revert "support sorting AbstractStrings"
May 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
resolve method ambiguity
  • Loading branch information
Lilith Hafner authored and Lilith Hafner committed Feb 18, 2023
commit 264836d24cf8face7a799223552e5d8b4e7f4bb1
1 change: 1 addition & 0 deletions base/sort.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,7 @@ _sort(x::NTuple{N}, o::Ordering) where N =
merge(_sort(ntuple(i -> x[i], N>>1), o), _sort(ntuple(i -> x[i+N>>1], N - N>>1), o), o)
merge(x::NTuple, y::NTuple{0}, o::Ordering) = x
merge(x::NTuple{0}, y::NTuple, o::Ordering) = y
merge(x::NTuple{0}, y::NTuple{0}, o::Ordering) = x # Method ambiguity
merge(x::NTuple, y::NTuple, o::Ordering) =
(lt(o, y[1], x[1]) ? (y[1], merge(x, tail(y), o)...) : (x[1], merge(tail(x), y, o)...))

Expand Down