Skip to content

Commit 5aae6ff

Browse files
committed
Fixup type instability due to boxes
1 parent a3c1024 commit 5aae6ff

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

base/abstractarray.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2081,11 +2081,11 @@ function hash(A::AbstractArray, h::UInt)
20812081
i = last(I)
20822082
v1 = A[i]
20832083
h = hash(i=>v1, h)
2084-
i = findprev(x->!isequal(x, v1), A, i)
2084+
i = let v1=v1; findprev(x->!isequal(x, v1), A, i); end
20852085
i === nothing && return h
20862086
v2 = A[i]
20872087
h = hash(i=>v2, h)
2088-
i = findprev(x->!isequal(x, v1) && !isequal(x, v2), A, i)
2088+
i = let v1=v1, v2=v2; findprev(x->!isequal(x, v1) && !isequal(x, v2), A, i); end
20892089
i === nothing && return h
20902090
h = hash(i=>A[i], h)
20912091

@@ -2096,7 +2096,7 @@ function hash(A::AbstractArray, h::UInt)
20962096
# an evenly divisible size).
20972097
J = vec(I) # Reshape the (potentially cartesian) keys to more efficiently compute the linear skips
20982098
j = LinearIndices(I)[i]
2099-
fibskip = prevfibskip = 1
2099+
fibskip = prevfibskip = oneunit(j)
21002100
while j > fibskip
21012101
j -= fibskip
21022102
h = hash(A[J[j]], h)

0 commit comments

Comments
 (0)