From 8a17546378c6b9481e81a27a7b3c9c6c5f794c0b Mon Sep 17 00:00:00 2001 From: Jun Tian Date: Sun, 18 Oct 2020 22:48:20 +0800 Subject: [PATCH] minor fix --- src/extensions/ElasticArrays.jl | 1 + src/utils/reservoir_array_buffer.jl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/extensions/ElasticArrays.jl b/src/extensions/ElasticArrays.jl index 5a67d22..a3fd3ad 100644 --- a/src/extensions/ElasticArrays.jl +++ b/src/extensions/ElasticArrays.jl @@ -1,6 +1,7 @@ using ElasticArrays Base.push!(a::ElasticArray, x) = append!(a, x) +Base.push!(a::ElasticArray{T,1}, x) where T = append!(a, [x]) Base.empty!(a::ElasticArray) = ElasticArrays.resize_lastdim!(a, 0) function Base.pop!(a::ElasticArray) diff --git a/src/utils/reservoir_array_buffer.jl b/src/utils/reservoir_array_buffer.jl index 5283a85..16d6f02 100644 --- a/src/utils/reservoir_array_buffer.jl +++ b/src/utils/reservoir_array_buffer.jl @@ -26,7 +26,7 @@ Base.IndexStyle function Base.push!(b::ReservoirArrayBuffer{T,N}, x) where {T,N} b.n += 1 if b.n <= b.capacity - append!(b.buffer, x) + push!(b.buffer, x) else i = rand(b.rng, 1:b.n) if i <= b.capacity