Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/DataStructures.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ module DataStructures

import Base.insert!

# public unsetindex! API introduced in 1.14 (julia#58943)
if isdefined(Base, :unsetindex!)
using Base: unsetindex!
else
using Base: _unsetindex! as unsetindex!
end

using OrderedCollections
using OrderedCollections: isordered
export OrderedDict, OrderedSet, LittleDict
Expand Down
4 changes: 2 additions & 2 deletions src/circ_deque.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ end

@inline Base.@propagate_inbounds function Base.pop!(D::CircularDeque)
v = last(D)
Base._unsetindex!(D.buffer, D.last) # see issue/884
unsetindex!(D.buffer, D.last) # see issue/884
D.n -= 1
tmp = D.last - 1
D.last = ifelse(tmp < 1, D.capacity, tmp)
Expand Down Expand Up @@ -92,7 +92,7 @@ Remove the element at the front.
"""
@inline Base.@propagate_inbounds function Base.popfirst!(D::CircularDeque)
v = first(D)
Base._unsetindex!(D.buffer, D.first) # see issue/884
unsetindex!(D.buffer, D.first) # see issue/884
D.n -= 1
tmp = D.first + 1
D.first = ifelse(tmp > D.capacity, 1, tmp)
Expand Down
4 changes: 2 additions & 2 deletions src/deque.jl
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ function Base.pop!(d::Deque{T}) where T
@assert rear.back >= rear.front

@inbounds x = rear.data[rear.back]
Base._unsetindex!(rear.data, rear.back) # see issue/884
unsetindex!(rear.data, rear.back) # see issue/884
rear.back -= 1
if rear.back < rear.front
if d.nblocks > 1
Expand All @@ -323,7 +323,7 @@ function Base.popfirst!(d::Deque{T}) where T
@assert head.back >= head.front

@inbounds x = head.data[head.front]
Base._unsetindex!(head.data, head.front) # see issue/884
unsetindex!(head.data, head.front) # see issue/884
head.front += 1
if head.back < head.front
if d.nblocks > 1
Expand Down
Loading