Skip to content

Commit b48fe60

Browse files
committed
Change type annotation and similar to zero
1 parent addfd17 commit b48fe60

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/PreallocationTools.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ end
8686
function Base.getindex(b::LazyBufferCache, u::T) where {T <: AbstractArray}
8787
s = b.sizemap(size(u)) # required buffer size
8888
buf = get!(b.bufs, (T, s)) do
89-
similar(u, s) # buffer to allocate if it was not found in b.bufs
90-
end::T # declare type since b.bufs dictionary is untyped
89+
# declare type since b.bufs dictionary is untyped
90+
zero(u)::T # buffer to allocate if it was not found in b.bufs
91+
end
9192
return buf
9293
end
9394

0 commit comments

Comments
 (0)