Skip to content

Commit 1dc7b70

Browse files
authored
Merge pull request #616 from harryscholes/fix-614
Remove deprecated deque method
2 parents 48ba4d0 + 120fe91 commit 1dc7b70

File tree

5 files changed

+8
-15
lines changed

5 files changed

+8
-15
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "DataStructures"
22
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
3-
version = "0.17.14"
3+
version = "0.17.15"
44

55
[deps]
66
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"

src/DataStructures.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module DataStructures
2121
export complement, complement!
2222

2323
export Deque, Stack, Queue, CircularDeque
24-
export deque, enqueue!, dequeue!, dequeue_pair!, update!, reverse_iter
24+
export enqueue!, dequeue!, dequeue_pair!, update!, reverse_iter
2525
export capacity, num_blocks, top_with_handle, sizehint!
2626

2727
export Accumulator, counter, reset!, inc!, dec!

src/deque.jl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,6 @@ mutable struct Deque{T}
8181
Deque{T}() where {T} = Deque{T}(DEFAULT_DEQUEUE_BLOCKSIZE)
8282
end
8383

84-
"""
85-
deque(T)
86-
87-
Create a deque of type `T`.
88-
"""
89-
deque(::Type{T}) where {T} = Deque{T}()
90-
9184
isempty(q::Deque) = q.len == 0
9285
length(q::Deque) = q.len
9386
num_blocks(q::Deque) = q.nblocks

test/bench_deque.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function batch_pushback!(v::Container, n::Int, e::T) where {Container,T}
1111
end
1212

1313
v = Int[]
14-
q = deque(Int)
14+
q = Deque{Int}()
1515

1616
batch_pushback!(v, 10, 0)
1717
t1 = @elapsed batch_pushback!(v, 10^7, 0)
@@ -33,7 +33,7 @@ function batch_pushfront!(v::Container, n::Int, e::T) where {Container,T}
3333
end
3434

3535
v = Int[]
36-
q = deque(Int)
36+
q = Deque{Int}()
3737

3838
batch_pushfront!(v, 10, 0)
3939
t1 = @elapsed batch_pushfront!(v, 10^7, 0)

test/test_deque.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
@test length(sprint(dump,q)) >= 0
1313
end
1414

15-
@testset "empty dequeue 2" begin
16-
@test typeof(deque(Int)) === typeof(Deque{Int}())
17-
end
18-
1915
@testset "empty dequeue 3" begin
2016
q = DataStructures.DequeBlock{Int}(0,0)
2117
@test length(q) == 0
@@ -202,4 +198,8 @@
202198
@test isempty(q)
203199
end
204200

201+
@testset "deprecated constructors" begin
202+
@test_deprecated deque(Int)
203+
end
204+
205205
end # @testset Deque

0 commit comments

Comments
 (0)