Skip to content

Commit

Permalink
Removed not-needed test on element type of dest
Browse files Browse the repository at this point in the history
  • Loading branch information
PGS62 committed Apr 3, 2024
1 parent 467ddf5 commit 93152a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/pairwise.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function _pairwise!(::Val{:none}, f, dest::AbstractMatrix{V}, x, y,
for j in subset
for i = 1:(symmetric ? j : nc)
# For performance, diagonal is special-cased
if diag_is_1 && i == j && y[i] === x[j] && V !== Union{}
if diag_is_1 && i == j && y[i] === x[j]
dest[j, i] = V === Missing ? missing : 1.0
else
dest[j, i] = f(x[j], y[i])
Expand Down Expand Up @@ -101,7 +101,7 @@ function _pairwise!(::Val{:pairwise}, f, dest::AbstractMatrix{V}, x, y, symmetri
scratch_fy = task_local_vector(:scratch_fy, nmty, m)
for j in subset
for i = 1:(symmetric ? j : nc)
if diag_is_1 && i == j && y[i] === x[j] && V !== Union{} && V !== Missing
if diag_is_1 && i == j && y[i] === x[j] && V !== Missing
dest[j, i] = 1.0
else
dest[j, i] = f(handle_pairwise(x[j], y[i]; scratch_fx=scratch_fx, scratch_fy=scratch_fy)...)
Expand Down
4 changes: 2 additions & 2 deletions src/rankcorr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function _pairwise!(::Val{:pairwise}, f::typeof(corspearman),

for i = 1:(symmetric ? j : nc)
# For performance, diagonal is special-cased
if x[j] === y[i] && i == j && V !== Union{}
if x[j] === y[i] && i == j
if missing isa V && eltype(x[j]) == Missing
dest[j, i] = missing
else
Expand Down Expand Up @@ -503,7 +503,7 @@ function corkendall_loop!(skipmissing::Symbol, f::typeof(corkendall), dest::Abst

for i = 1:(symmetric ? j : nc)
# For performance, diagonal is special-cased
if x[j] === y[i] && i == j && V !== Union{}
if x[j] === y[i] && i == j
if missing isa V && eltype(x[j]) == Missing
dest[j, i] = missing
else
Expand Down

0 comments on commit 93152a0

Please sign in to comment.