Skip to content

Commit

Permalink
Merge pull request JuliaLang#13977 from mlubin/push
Browse files Browse the repository at this point in the history
Fix type instability in push!
  • Loading branch information
tkelman committed Nov 14, 2015
2 parents 1ee33a6 + c017f24 commit de01e04
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 de01e04

Please sign in to comment.