From 3a7d62b022f7389cd6f8fde730a71cf94cae4722 Mon Sep 17 00:00:00 2001 From: Tianyi Pu <912396513@qq.com> Date: Wed, 13 Sep 2023 09:36:49 +0100 Subject: [PATCH 1/3] Update TupleTools.jl --- src/TupleTools.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/TupleTools.jl b/src/TupleTools.jl index f5511a4..e55c893 100644 --- a/src/TupleTools.jl +++ b/src/TupleTools.jl @@ -250,7 +250,8 @@ end _sort(t::Tuple{Any}, lt=isless, by=identity, rev::Bool=false) = t _sort(t::Tuple{}, lt=isless, by=identity, rev::Bool=false) = t -function _split(t::NTuple{N}) where N +function _split(t::Tuple) + N = length(t) M = N>>1 ntuple(i->t[i], M), ntuple(i->t[i+M], N-M) end From 8273984b0c0ffed567e186a46df3c4b565d703f9 Mon Sep 17 00:00:00 2001 From: Tianyi Pu <912396513@qq.com> Date: Wed, 13 Sep 2023 09:50:05 +0100 Subject: [PATCH 2/3] Update runtests.jl --- test/runtests.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/runtests.jl b/test/runtests.jl index e40a4c2..6ec9d96 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -77,3 +77,5 @@ end @test @inferred(TupleTools.diff(())) == () @test @inferred(TupleTools.diff((1, ))) == () @test @inferred(TupleTools.diff((1, 2, 3))) == (1, 1) + +@test TupleTools.sort(2,1,3.0) === (1,2,3.0) \ No newline at end of file From 20333f5838e5637ed7e88840b01cb4b6ce2e8c31 Mon Sep 17 00:00:00 2001 From: Tianyi Pu <912396513@qq.com> Date: Wed, 13 Sep 2023 10:05:12 +0100 Subject: [PATCH 3/3] fix --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 6ec9d96..976e1d1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -78,4 +78,4 @@ end @test @inferred(TupleTools.diff((1, ))) == () @test @inferred(TupleTools.diff((1, 2, 3))) == (1, 1) -@test TupleTools.sort(2,1,3.0) === (1,2,3.0) \ No newline at end of file +@test TupleTools.sort((2,1,3.0)) === (1,2,3.0) \ No newline at end of file