Skip to content

Commit

Permalink
avoid an extra tuple allocation in deserializing 1d arrays.
Browse files Browse the repository at this point in the history
slightly helps JuliaLang#7893
  • Loading branch information
JeffBezanson authored and skumagai committed Aug 18, 2014
1 parent d041674 commit 5133c46
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions base/serialize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,9 @@ function deserialize(s, ::Type{Array})
elty = Uint8
end
if isa(d1,Integer)
if elty !== Bool && isbits(elty)
return read!(s, Array(elty, d1))
end
dims = (int(d1),)
else
dims = convert(Dims, d1)::Dims
Expand Down

0 comments on commit 5133c46

Please sign in to comment.