From 93152a028ed71e9d4377be3bd0fe0c5948431b6f Mon Sep 17 00:00:00 2001 From: Philip Swannell <18028484+PGS62@users.noreply.github.com> Date: Wed, 3 Apr 2024 12:07:10 +0100 Subject: [PATCH] Removed not-needed test on element type of dest --- src/pairwise.jl | 4 ++-- src/rankcorr.jl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pairwise.jl b/src/pairwise.jl index 7c1def2..ca88353 100644 --- a/src/pairwise.jl +++ b/src/pairwise.jl @@ -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]) @@ -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)...) diff --git a/src/rankcorr.jl b/src/rankcorr.jl index 1cb7563..1fc37be 100644 --- a/src/rankcorr.jl +++ b/src/rankcorr.jl @@ -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 @@ -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