File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -87,13 +87,12 @@ struct LazyBufferCache{F<:Function}
8787end
8888
8989# override the [] method
90- function Base. getindex (b:: LazyBufferCache , u:: AbstractArray{T} ) where {T}
90+ function Base. getindex (b:: LazyBufferCache , u:: T ) where {T<: AbstractArray }
9191 n = b. lengthmap (size (u)) # required buffer length
92- buf = get! (b. bufs, T) do
93- similar (u, T, n) # buffer to allocate if it was not found in b.bufs
94- end :: typeof (u) # declare type since b.bufs dictionary is untyped
95- # Doesn't work well with matrices, needs more thought!
96- # return resize!(buf, n) # resize the buffer if needed, e.g. if problem was resized
92+ buf = get! (b. bufs, (T, n)) do
93+ similar (u, n) # buffer to allocate if it was not found in b.bufs
94+ end :: T # declare type since b.bufs dictionary is untyped
95+ return buf
9796end
9897
9998export dualcache, get_tmp, LazyBufferCache
You can’t perform that action at this time.
0 commit comments