Skip to content

Commit

Permalink
Fix type instability in push!
Browse files Browse the repository at this point in the history
(cherry picked from commit c017f24)
ref #13977
  • Loading branch information
mlubin authored and tkelman committed Nov 29, 2015
1 parent cd06a1f commit 4affae3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,9 @@ end

function push!{T}(a::Array{T,1}, item)
# convert first so we don't grow the array if the assignment won't work
item = convert(T, item)
itemT = convert(T, item)
ccall(:jl_array_grow_end, Void, (Any, UInt), a, 1)
a[end] = item
a[end] = itemT
return a
end

Expand Down

0 comments on commit 4affae3

Please sign in to comment.