diff --git a/base/dict.jl b/base/dict.jl index c27936ffb2c3e..4bcdce7931df0 100644 --- a/base/dict.jl +++ b/base/dict.jl @@ -326,12 +326,10 @@ function ht_keyindex2!(h::Dict{K,V}, key) where V where K # in case "key" already exists in a later collided slot. avail = -index end - else - if h.slots[index] == sh - k = pairs[index].first - if key === k || isequal(key, k) - return index, sh - end + elseif h.slots[index] == sh + k = pairs[index].first + if key === k || isequal(key, k) + return index, sh end end