Skip to content

Commit

Permalink
Fix type instability in push!
Browse files Browse the repository at this point in the history
  • Loading branch information
mlubin committed Nov 13, 2015
1 parent f045831 commit c017f24
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 @@ -420,9 +420,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 c017f24

Please sign in to comment.