Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
bkamins authored Nov 18, 2021
1 parent 9c6dec9 commit f80d58e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/PooledArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -590,12 +590,12 @@ end
##
##############################################################################

function Base.push!(pv::PooledVector, v)
function Base.push!(pv::PooledVector, v) # this function is not thread safe
push!(pv.refs, getpoolidx(pv, v))
return pv
end

function Base.insert!(pv::PooledVector, i::Integer, v)
function Base.insert!(pv::PooledVector, i::Integer, v) # this function is not thread safe
i isa Bool && throw(ArgumentError("invalid index: $i of type Bool"))
if !(1 <= i <= length(pv.refs) + 1)
throw(BoundsError("attempt to insert to a vector with length $(length(pv)) at index $i"))
Expand Down

0 comments on commit f80d58e

Please sign in to comment.