Skip to content

Commit 783dd9b

Browse files
Resolve review comments
Co-authored-by: Lyndon White <[email protected]>
1 parent 11d92e7 commit 783dd9b

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/DataStructures.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ module DataStructures
55
isbitsunion, isiterable, dict_with_eltype, KeySet, Callable, _tablesz,
66
findnextnot, unsafe_getindex, unsafe_setindex!, peek
77

8-
if !isdefined(Base, :popat!)
9-
export popat!
10-
end
8+
export popat! # Export for old version of julia where Base doesn't export this
119

1210

1311
using Compat # Provides Base.Order.ReverseOrdering(). May remove this line with julia 1.4

src/priorityqueue.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,13 +274,11 @@ function Base.popfirst!(pq::PriorityQueue)
274274
return x
275275
end
276276

277-
if isdefined(Base, :popat!)
278-
Base.popat!(pq::PriorityQueue, key) = _popat!(pq, key)
279-
else
280-
popat!(pq::PriorityQueue, key) = _popat!(pq, key)
277+
if isdefined(Base, :popat!) # We will overload if it is defined, else we define on our own
278+
import Base: popat!
281279
end
282280

283-
function _popat!(pq::PriorityQueue, key)
281+
function popat!(pq::PriorityQueue, key)
284282
idx = pq.index[key]
285283
force_up!(pq, idx)
286284
popfirst!(pq)

0 commit comments

Comments
 (0)