Skip to content

Commit

Permalink
force specialization on cmp
Browse files Browse the repository at this point in the history
  • Loading branch information
LilithHafner committed Jun 1, 2024
1 parent 1b77406 commit 7742143
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/QuadSort.jl
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ function quad_reversal!(array, pta::Int, ptz::Int)
end
end

function quad_swap_merge!(array, array_index::Int, swap, swap_index::Int, cmp)
function quad_swap_merge!(array, array_index::Int, swap, swap_index::Int, cmp::T) where T
parity_merge_two!(array, array_index, swap, swap_index, cmp)
parity_merge_two!(array, array_index +4, swap, swap_index +4, cmp)
parity_merge_four!(swap, swap_index, array, array_index, cmp)
Expand Down Expand Up @@ -524,7 +524,7 @@ function quad_merge_block!(array, array_index::Int, swap, swap_index::Int, block
end
end

function quad_merge!(array, array_index::Int, swap, swap_index::Int, swap_size::UInt, nmemb::UInt, block::UInt, cmp)
function quad_merge!(array, array_index::Int, swap, swap_index::Int, swap_size::UInt, nmemb::UInt, block::UInt, cmp::T) where T
pte = array_index + asInt(nmemb)
block *= 4
while block nmemb && block swap_size
Expand Down Expand Up @@ -690,7 +690,7 @@ function partial_backward_merge!(array, array_index::Int, swap, swap_index::Int,
end
end

function tail_merge!(array, array_index::Int, swap, swap_index::Int, swap_size::UInt, nmemb::UInt, block::UInt, cmp)
function tail_merge!(array, array_index::Int, swap, swap_index::Int, swap_size::UInt, nmemb::UInt, block::UInt, cmp::T) where T
pte = array_index + asInt(nmemb)
while block < nmemb && block swap_size
pta = array_index
Expand Down Expand Up @@ -882,7 +882,7 @@ function rotate_merge_block!(array, array_index::Int, swap, swap_index::Int, swa
end
end

function rotate_merge!(array, array_index::Int, swap, swap_index::Int, swap_size::UInt, nmemb::UInt, block::UInt, cmp)
function rotate_merge!(array, array_index::Int, swap, swap_index::Int, swap_size::UInt, nmemb::UInt, block::UInt, cmp::T) where T
if nmemb 2block && nmemb - block swap_size # unsigned subtraction, ensures nmemb ≥ block
partial_backward_merge!(array, array_index, swap, swap_index, swap_size, nmemb, block, cmp)
return
Expand Down

0 comments on commit 7742143

Please sign in to comment.