Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Nick Robinson <npr251@gmail.com>
  • Loading branch information
kpamnany and nickrobinson251 authored Feb 20, 2024
1 parent 00aa3ed commit 7fb161c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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)
Base._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)
Base._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)
Base._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)
Base._unsetindex!(head.data, head.front) # see issue/884
head.front += 1
if head.back < head.front
if d.nblocks > 1
Expand Down

0 comments on commit 7fb161c

Please sign in to comment.