diff --git a/REQUIRE b/REQUIRE index 137767a42..918dea87c 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1 +1,2 @@ julia 0.6 +Compat 0.40 diff --git a/src/DataStructures.jl b/src/DataStructures.jl index a17ebc5ca..22e69ce20 100644 --- a/src/DataStructures.jl +++ b/src/DataStructures.jl @@ -16,6 +16,13 @@ module DataStructures union, intersect, symdiff, setdiff, issubset, find, searchsortedfirst, searchsortedlast, endof, in + import Compat.uninitialized + @static if !isdefined(Base, :KeySet) # https://github.com/JuliaLang/julia/pull/24580 + const KeySet{K,T<:Associative{K}} = Base.KeyIterator{T} + else + import Base.KeySet + end + export Deque, Stack, Queue, CircularDeque export deque, enqueue!, dequeue!, dequeue_pair!, update!, reverse_iter export capacity, num_blocks, front, back, top, top_with_handle, sizehint! @@ -52,7 +59,11 @@ module DataStructures import Base: eachindex, keytype, valtype - _include_string(str) = eval(parse(str)) + @static if VERSION < v"0.7.0-DEV.2437" + _include_string(str) = eval(parse(str)) + else + _include_string(str) = eval(Meta.parse(str)) + end include("delegate.jl") @@ -106,13 +117,13 @@ module DataStructures # Remove when Julia 0.7 (or whatever version is after v0.6) is released @deprecate DefaultDictBase(default, ks::AbstractArray, vs::AbstractArray) DefaultDictBase(default, zip(ks, vs)) @deprecate DefaultDictBase(default, ks, vs) DefaultDictBase(default, zip(ks, vs)) - @deprecate DefaultDictBase{K,V}(::Type{K}, ::Type{V}, default) DefaultDictBase{K,V}(default) + @deprecate DefaultDictBase(::Type{K}, ::Type{V}, default) where {K,V} DefaultDictBase{K,V}(default) @deprecate DefaultDict(default, ks, vs) DefaultDict(default, zip(ks, vs)) - @deprecate DefaultDict{K,V}(::Type{K}, ::Type{V}, default) DefaultDict{K,V}(default) + @deprecate DefaultDict(::Type{K}, ::Type{V}, default) where {K,V} DefaultDict{K,V}(default) @deprecate DefaultOrderedDict(default, ks, vs) DefaultOrderedDict(default, zip(ks, vs)) - @deprecate DefaultOrderedDict{K,V}(::Type{K}, ::Type{V}, default) DefaultOrderedDict{K,V}(default) + @deprecate DefaultOrderedDict(::Type{K}, ::Type{V}, default) where {K,V} DefaultOrderedDict{K,V}(default) function SortedMultiDict(ks::AbstractVector{K}, vs::AbstractVector{V}, @@ -124,10 +135,10 @@ module DataStructures SortedMultiDict(o, zip(ks,vs)) end - @deprecate PriorityQueue{K,V}(::Type{K}, ::Type{V}) PriorityQueue{K,V}() - @deprecate PriorityQueue{K,V}(::Type{K}, ::Type{V}, o::Ordering) PriorityQueue{K,V,typeof(o)}(o) + @deprecate PriorityQueue(::Type{K}, ::Type{V}) where {K,V} PriorityQueue{K,V}() + @deprecate PriorityQueue(::Type{K}, ::Type{V}, o::Ordering) where {K,V} PriorityQueue{K,V,typeof(o)}(o) @deprecate (PriorityQueue{K,V,ForwardOrdering}() where {K,V}) PriorityQueue{K,V}() - + function PriorityQueue(ks::AbstractVector{K}, vs::AbstractVector{V}, o::Ordering=Forward) where {K,V} @@ -137,5 +148,5 @@ module DataStructures end PriorityQueue(o, zip(ks,vs)) end - + end diff --git a/src/balanced_tree.jl b/src/balanced_tree.jl index 18811efa3..b43c25a35 100644 --- a/src/balanced_tree.jl +++ b/src/balanced_tree.jl @@ -125,15 +125,15 @@ mutable struct BalancedTree23{K, D, Ord <: Ordering} deletionchild::Array{Int,1} deletionleftkey::Array{K,1} function BalancedTree23{K,D,Ord}(ord1::Ord) where {K,D,Ord<:Ordering} - tree1 = Vector{TreeNode{K}}(1) + tree1 = Vector{TreeNode{K}}(uninitialized, 1) initializeTree!(tree1) - data1 = Vector{KDRec{K,D}}(2) + data1 = Vector{KDRec{K,D}}(uninitialized, 2) initializeData!(data1) u1 = IntSet() push!(u1, 1, 2) - new{K,D,Ord}(ord1, data1, tree1, 1, 1, Vector{Int}(0), Vector{Int}(0), + new{K,D,Ord}(ord1, data1, tree1, 1, 1, Vector{Int}(), Vector{Int}(), u1, - Vector{Int}(3), Vector{K}(3)) + Vector{Int}(uninitialized, 3), Vector{K}(uninitialized, 3)) end end @@ -243,8 +243,8 @@ function empty!(t::BalancedTree23) initializeTree!(t.tree) t.depth = 1 t.rootloc = 1 - t.freetreeinds = Vector{Int}(0) - t.freedatainds = Vector{Int}(0) + t.freetreeinds = Vector{Int}() + t.freedatainds = Vector{Int}() empty!(t.useddatacells) push!(t.useddatacells, 1, 2) nothing diff --git a/src/circ_deque.jl b/src/circ_deque.jl index deb48b629..131d66989 100644 --- a/src/circ_deque.jl +++ b/src/circ_deque.jl @@ -11,7 +11,7 @@ mutable struct CircularDeque{T} last::Int end -CircularDeque{T}(n::Int) where {T} = CircularDeque(Vector{T}(n), n, 0, 1, n) +CircularDeque{T}(n::Int) where {T} = CircularDeque(Vector{T}(uninitialized, n), n, 0, 1, n) Base.length(D::CircularDeque) = D.n Base.eltype(::Type{CircularDeque{T}}) where {T} = T diff --git a/src/classified_collections.jl b/src/classified_collections.jl index 0c1eea6a0..a41a6ae43 100644 --- a/src/classified_collections.jl +++ b/src/classified_collections.jl @@ -16,7 +16,7 @@ classified_lists(K::Type, V::Type) = ClassifiedCollections(K, Vector{V}) classified_sets(K::Type, V::Type) = ClassifiedCollections(K, Set{V}) classified_counters(K::Type, T::Type) = ClassifiedCollections(K, Accumulator{T, Int}) -_create_empty(::Type{Vector{T}}) where {T} = Vector{T}(0) +_create_empty(::Type{Vector{T}}) where {T} = Vector{T}() _create_empty(::Type{Set{T}}) where {T} = Set{T}() _create_empty(::Type{Accumulator{T,V}}) where {T,V} = Accumulator(T, V) diff --git a/src/default_dict.jl b/src/default_dict.jl index 8d33d176f..7fdda9fe9 100644 --- a/src/default_dict.jl +++ b/src/default_dict.jl @@ -58,8 +58,8 @@ DefaultDictBase{K,V}(default::F) where {K,V,F} = DefaultDictBase{K,V,F,Dict{K,V} @delegate_return_parent DefaultDictBase.d [ delete!, empty!, setindex!, sizehint! ] similar(d::DefaultDictBase{K,V,F}) where {K,V,F} = DefaultDictBase{K,V,F}(d.default) -in(key, v::Base.KeyIterator{T}) where {T<:DefaultDictBase} = key in keys(v.dict.d) -next(v::Base.KeyIterator{T}, i) where {T<:DefaultDictBase} = (v.dict.d.keys[i], Base.skip_deleted(v.dict.d,i+1)) +in(key, v::KeySet{<:Any,T}) where {T<:DefaultDictBase} = key in keys(v.dict.d) +next(v::KeySet{<:Any,T}, i) where {T<:DefaultDictBase} = (v.dict.d.keys[i], Base.skip_deleted(v.dict.d,i+1)) next(v::Base.ValueIterator{T}, i) where {T<:DefaultDictBase} = (v.dict.d.vals[i], Base.skip_deleted(v.dict.d,i+1)) getindex(d::DefaultDictBase, key) = get!(d.d, key, d.default) @@ -138,7 +138,7 @@ for _Dict in [:Dict, :OrderedDict] push!(d::$DefaultDict, p, q, r...) = push!(push!(push!(d, p), q), r...) similar(d::$DefaultDict{K,V,F}) where {K,V,F} = $DefaultDict{K,V,F}(d.d.default) - in(key, v::Base.KeyIterator{T}) where {T<:$DefaultDict} = key in keys(v.dict.d.d) + in(key, v::KeySet{<:Any,T}) where {T<:$DefaultDict} = key in keys(v.dict.d.d) end end @@ -182,4 +182,4 @@ isordered(::Type{T}) where {T<:DefaultOrderedDict} = true # @delegate_return_parent DefaultSortedDict.d [ delete!, empty!, setindex!, sizehint! ] # similar{K,V,F}(d::DefaultSortedDict{K,V,F}) = DefaultSortedDict{K,V,F}(d.d.default) -# in{T<:DefaultSortedDict}(key, v::Base.KeyIterator{T}) = key in keys(v.dict.d.d) +# in{T<:DefaultSortedDict}(key, v::KeySet{<:Any,T}) = key in keys(v.dict.d.d) diff --git a/src/delegate.jl b/src/delegate.jl index 08a66d160..274dbc47b 100644 --- a/src/delegate.jl +++ b/src/delegate.jl @@ -14,7 +14,7 @@ macro delegate(source, targets) fieldname = unquote(source.args[2]) funcnames = targets.args n = length(funcnames) - fdefs = Vector{Any}(n) + fdefs = Vector{Any}(uninitialized, n) for i in 1:n funcname = esc(funcnames[i]) fdefs[i] = quote @@ -30,7 +30,7 @@ macro delegate_return_parent(source, targets) fieldname = unquote(source.args[2]) funcnames = targets.args n = length(funcnames) - fdefs = Vector{Any}(n) + fdefs = Vector{Any}(uninitialized, n) for i in 1:n funcname = esc(funcnames[i]) fdefs[i] = quote diff --git a/src/deque.jl b/src/deque.jl index 34673dade..b974f26a7 100644 --- a/src/deque.jl +++ b/src/deque.jl @@ -14,7 +14,7 @@ mutable struct DequeBlock{T} next::DequeBlock{T} # ref to next block function DequeBlock{T}(capa::Int, front::Int) where T - data = Vector{T}(capa) + data = Vector{T}(uninitialized, capa) blk = new{T}(data, capa, front, front-1) blk.prev = blk blk.next = blk diff --git a/src/heaps.jl b/src/heaps.jl index a89e04cb6..c56410d78 100644 --- a/src/heaps.jl +++ b/src/heaps.jl @@ -71,7 +71,7 @@ include("heaps/arrays_as_heaps.jl") function extract_all!(h::AbstractHeap{VT}) where VT n = length(h) - r = Vector{VT}(n) + r = Vector{VT}(uninitialized, n) for i = 1 : n r[i] = pop!(h) end @@ -80,7 +80,7 @@ end function extract_all_rev!(h::AbstractHeap{VT}) where VT n = length(h) - r = Vector{VT}(n) + r = Vector{VT}(uninitialized, n) for i = 1 : n r[n + 1 - i] = pop!(h) end diff --git a/src/heaps/binary_heap.jl b/src/heaps/binary_heap.jl index 7bd4db321..baad627f1 100644 --- a/src/heaps/binary_heap.jl +++ b/src/heaps/binary_heap.jl @@ -107,7 +107,7 @@ mutable struct BinaryHeap{T,Comp} <: AbstractHeap{T} valtree::Vector{T} function BinaryHeap{T,Comp}(comp::Comp) where {T,Comp} - new{T,Comp}(comp, Vector{T}(0)) + new{T,Comp}(comp, Vector{T}()) end function BinaryHeap{T,Comp}(comp::Comp, xs) where {T,Comp} # xs is an iterable collection of values diff --git a/src/heaps/mutable_binary_heap.jl b/src/heaps/mutable_binary_heap.jl index e158466ec..cbb77addb 100644 --- a/src/heaps/mutable_binary_heap.jl +++ b/src/heaps/mutable_binary_heap.jl @@ -127,8 +127,8 @@ function _make_mutable_binary_heap(comp::Comp, ty::Type{T}, values) where {Comp, # make a static binary index tree from a list of values n = length(values) - nodes = Vector{MutableBinaryHeapNode{T}}(n) - nodemap = Vector{Int}(n) + nodes = Vector{MutableBinaryHeapNode{T}}(uninitialized, n) + nodemap = Vector{Int}(uninitialized, n) i::Int = 0 for v in values @@ -156,8 +156,8 @@ mutable struct MutableBinaryHeap{VT, Comp} <: AbstractMutableHeap{VT,Int} node_map::Vector{Int} function MutableBinaryHeap{VT, Comp}(comp::Comp) where {VT, Comp} - nodes = Vector{MutableBinaryHeapNode{VT}}(0) - node_map = Vector{Int}(0) + nodes = Vector{MutableBinaryHeapNode{VT}}() + node_map = Vector{Int}() new{VT, Comp}(comp, nodes, node_map) end diff --git a/src/int_set.jl b/src/int_set.jl index cc597b12a..f73dbdc70 100644 --- a/src/int_set.jl +++ b/src/int_set.jl @@ -14,7 +14,7 @@ end mutable struct IntSet bits::BitVector inverse::Bool - IntSet() = new(fill!(BitVector(256), false), false) + IntSet() = new(falses(256), false) end IntSet(itr) = union!(IntSet(), itr) @@ -63,7 +63,7 @@ function _matchlength!(b::BitArray, newlen::Integer) len = length(b) len > newlen && return splice!(b, newlen+1:len) len < newlen && _resize0!(b, newlen) - return BitVector(0) + return BitVector() end const _intset_bounds_err_msg = "elements of IntSet must be between 0 and typemax(Int)-1" diff --git a/src/ordered_dict.jl b/src/ordered_dict.jl index 034dd78c5..cb6bd3a12 100644 --- a/src/ordered_dict.jl +++ b/src/ordered_dict.jl @@ -4,7 +4,7 @@ import Base: haskey, get, get!, getkey, delete!, push!, pop!, empty!, setindex!, getindex, length, isempty, start, next, done, keys, values, setdiff, setdiff!, union, union!, intersect, filter, filter!, - hash, eltype, KeyIterator, ValueIterator, convert, copy, + hash, eltype, ValueIterator, convert, copy, merge """ @@ -21,7 +21,7 @@ mutable struct OrderedDict{K,V} <: Associative{K,V} dirty::Bool function OrderedDict{K,V}() where {K,V} - new{K,V}(zeros(Int32,16), Vector{K}(0), Vector{V}(0), 0, false) + new{K,V}(zeros(Int32,16), Vector{K}(), Vector{V}(), 0, false) end function OrderedDict{K,V}(kv) where {K,V} h = OrderedDict{K,V}() @@ -56,8 +56,8 @@ copy(d::OrderedDict) = OrderedDict(d) # OrderedDict{K,V}(kv::Tuple{Vararg{Tuple{K,V}}}) = OrderedDict{K,V}(kv) # OrderedDict{K }(kv::Tuple{Vararg{Tuple{K,Any}}}) = OrderedDict{K,Any}(kv) # OrderedDict{V }(kv::Tuple{Vararg{Tuple{Any,V}}}) = OrderedDict{Any,V}(kv) -_oldOrderedDict1 = "OrderedDict{V}(kv::Tuple{Vararg{Pair{TypeVar(:K),V}}}) = OrderedDict{Any,V}(kv)" -_newOrderedDict1 = "OrderedDict{V}(kv::Tuple{Vararg{Pair{K,V} where K}}) = OrderedDict{Any,V}(kv)" +_oldOrderedDict1 = "OrderedDict(kv::Tuple{Vararg{Pair{TypeVar(:K),V}}}) where {V} = OrderedDict{Any,V}(kv)" +_newOrderedDict1 = "OrderedDict(kv::Tuple{Vararg{Pair{K,V} where K}}) where {V} = OrderedDict{Any,V}(kv)" OrderedDict(kv::Tuple{Vararg{Pair{K,V}}}) where {K,V} = OrderedDict{K,V}(kv) OrderedDict(kv::Tuple{Vararg{Pair{K}}}) where {K} = OrderedDict{K,Any}(kv) VERSION < v"0.6.0-dev.2123" ? _include_string(_oldOrderedDict1) : _include_string(_newOrderedDict1) @@ -67,8 +67,8 @@ OrderedDict(kv::AbstractArray{Tuple{K,V}}) where {K,V} = OrderedDict{K,V}(kv) OrderedDict(kv::AbstractArray{Pair{K,V}}) where {K,V} = OrderedDict{K,V}(kv) OrderedDict(kv::Associative{K,V}) where {K,V} = OrderedDict{K,V}(kv) -_oldOrderedDict2 = "OrderedDict{V}(ps::Pair{TypeVar(:K),V}...,) = OrderedDict{Any,V}(ps)" -_newOrderedDict2 = "OrderedDict{V}(ps::(Pair{K,V} where K)...,) = OrderedDict{Any,V}(ps)" +_oldOrderedDict2 = "OrderedDict(ps::Pair{TypeVar(:K),V}...,) where {V} = OrderedDict{Any,V}(ps)" +_newOrderedDict2 = "OrderedDict(ps::(Pair{K,V} where K)...,) where {V} = OrderedDict{Any,V}(ps)" OrderedDict(ps::Pair{K,V}...) where {K,V} = OrderedDict{K,V}(ps) OrderedDict(ps::Pair{K}...,) where {K} = OrderedDict{K,Any}(ps) VERSION < v"0.6.0-dev.2123" ? _include_string(_oldOrderedDict2) : _include_string(_newOrderedDict2) @@ -376,7 +376,7 @@ function get(default::Base.Callable, h::OrderedDict{K,V}, key) where {K,V} end haskey(h::OrderedDict, key) = (ht_keyindex(h, key, true) >= 0) -in(key, v::KeyIterator{T}) where {T<:OrderedDict} = (ht_keyindex(v.dict, key, true) >= 0) +in(key, v::KeySet{<:Any,T}) where {T<:OrderedDict} = (ht_keyindex(v.dict, key, true) >= 0) function getkey(h::OrderedDict{K,V}, key, default) where {K,V} index = ht_keyindex(h, key, true) @@ -429,7 +429,7 @@ end done(t::OrderedDict, i) = done(t.keys, i) next(t::OrderedDict, i) = (Pair(t.keys[i],t.vals[i]), i+1) -next(v::KeyIterator{T}, i) where {T<:OrderedDict} = (v.dict.keys[i], i+1) +next(v::KeySet{<:Any,T}, i) where {T<:OrderedDict} = (v.dict.keys[i], i+1) next(v::ValueIterator{T}, i) where {T<:OrderedDict} = (v.dict.vals[i], i+1) function merge(d::OrderedDict, others::Associative...) diff --git a/src/priorityqueue.jl b/src/priorityqueue.jl index 0f553365f..f17b8c8af 100644 --- a/src/priorityqueue.jl +++ b/src/priorityqueue.jl @@ -32,11 +32,11 @@ mutable struct PriorityQueue{K,V,O<:Ordering} <: Associative{K,V} index::Dict{K, Int} function PriorityQueue{K,V,O}(o::O) where {K,V,O<:Ordering} - new{K,V,O}(Vector{Pair{K,V}}(0), o, Dict{K, Int}()) + new{K,V,O}(Vector{Pair{K,V}}(), o, Dict{K, Int}()) end function PriorityQueue{K,V,O}(o::O, itr) where {K,V,O<:Ordering} - xs = Vector{Pair{K,V}}(length(itr)) + xs = Vector{Pair{K,V}}(uninitialized, length(itr)) index = Dict{K, Int}() for (i, (k, v)) in enumerate(itr) xs[i] = Pair{K,V}(k, v) @@ -225,7 +225,7 @@ function enqueue!(pq::PriorityQueue{K,V}, pair::Pair{K,V}) where {K,V} push!(pq.xs, pair) pq.index[key] = length(pq) percolate_up!(pq, length(pq)) - + return pq end diff --git a/test/runtests.jl b/test/runtests.jl index 8b0e5dcd5..deae3ad1e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,7 +1,7 @@ -using Base.Test +using Compat.Test using DataStructures const IntSet = DataStructures.IntSet -using Primes +using Primes, Compat @test isempty(detect_ambiguities(Base, Core, DataStructures)) diff --git a/test/test_mutable_binheap.jl b/test/test_mutable_binheap.jl index 4c5c18266..430db0243 100644 --- a/test/test_mutable_binheap.jl +++ b/test/test_mutable_binheap.jl @@ -6,7 +6,7 @@ function heap_values(h::MutableBinaryHeap{VT,Comp}) where {VT,Comp} n = length(h) nodes = h.nodes @assert length(nodes) == n - vs = Vector{VT}(n) + vs = Vector{VT}(uninitialized, n) for i = 1 : n vs[i] = nodes[i].value end @@ -17,7 +17,7 @@ function list_values(h::MutableBinaryHeap{VT,Comp}) where {VT,Comp} n = length(h) nodes = h.nodes nodemap = h.node_map - vs = Vector{VT}(0) + vs = Vector{VT}() for i = 1 : length(nodemap) id = nodemap[i] if id > 0 diff --git a/test/test_ordered_dict.jl b/test/test_ordered_dict.jl index 771e70520..e33e94092 100644 --- a/test/test_ordered_dict.jl +++ b/test/test_ordered_dict.jl @@ -129,7 +129,7 @@ let _d = OrderedDict([("a", 0)]) v = [k for k in filter(x->length(x)==1, collect(keys(_d)))] - @test isa(v, Vector{String}) || isa(v, Vector{ASCIIString}) + @test isa(v, Vector{String}) end let d = OrderedDict(((1, 2), (3, 4))), diff --git a/test/test_ordered_set.jl b/test/test_ordered_set.jl index 7856fe967..639c346b1 100644 --- a/test/test_ordered_set.jl +++ b/test/test_ordered_set.jl @@ -136,9 +136,9 @@ # find s = OrderedSet([1,3,5,7]) - @test findfirst(s,1) == 1 - @test findfirst(s,7) == 4 - @test findfirst(s,2) == 0 + @test findfirst(equalto(1), s) == 1 + @test findfirst(equalto(7), s) == 4 + @test findfirst(equalto(2), s) == 0 # setdiff @test isequal(setdiff(OrderedSet([1,2,3]), OrderedSet()), OrderedSet([1,2,3])) diff --git a/test/test_priority_queue.jl b/test/test_priority_queue.jl index e435612d7..8c8e7f068 100644 --- a/test/test_priority_queue.jl +++ b/test/test_priority_queue.jl @@ -14,7 +14,7 @@ function test_issorted!(pq::PriorityQueue, priorities, rev=false) @test priorities[last] <= priorities[value] else @test priorities[value] <= priorities[last] - end + end value = last end end @@ -87,7 +87,7 @@ end pq11 = PriorityQueue(Pair{Char}['a'=>1,'b'=>2]) @test peek(pq11) == ('a'=>1) - + # duplicate key => ArgumentError @test_throws ArgumentError PriorityQueue('a'=>1, 'a'=>2) @@ -95,7 +95,7 @@ end @test_throws ArgumentError PriorityQueue(['a']) @test_throws ArgumentError PriorityQueue(Reverse, ['a']) @test_throws ArgumentError PriorityQueue{Char,Int}(Base.Order.Reverse, ['a']) - + # Silly test @test_throws ArgumentError PriorityQueue(Reverse, Reverse) @@ -139,7 +139,7 @@ end enqueue!(pq, kv) end test_issorted!(pq, priorities) - + # enqueing values via enqueue! pq = PriorityQueue() for (k, v) in priorities @@ -199,7 +199,7 @@ end xs = heapify(10:-1:1) @test issorted([heappop!(xs) for _ in 1:10]) - xs = Vector{Int}(0) + xs = Vector{Int}() for priority in values(priorities) heappush!(xs, priority) end diff --git a/test/test_sorted_containers.jl b/test/test_sorted_containers.jl index ee22dfc5f..72527b374 100644 --- a/test/test_sorted_containers.jl +++ b/test/test_sorted_containers.jl @@ -96,10 +96,10 @@ function checkcorrectness(t::DataStructures.BalancedTree23{K,D,Ord}, dsz = size(t.data, 1) tsz = size(t.tree, 1) r = t.rootloc - bfstreenodes = Vector{Int}(0) + bfstreenodes = Vector{Int}() tdpth = t.depth intree = IntSet() - levstart = Vector{Int}(tdpth) + levstart = Vector{Int}(uninitialized, tdpth) push!(bfstreenodes, r) levstart[1] = 1 push!(intree, r) @@ -132,8 +132,8 @@ function checkcorrectness(t::DataStructures.BalancedTree23{K,D,Ord}, end bfstreesize = size(bfstreenodes, 1) dataused = IntSet() - minkeys = Vector{K}(bfstreesize) - maxkeys = Vector{K}(bfstreesize) + minkeys = Vector{K}(uninitialized, bfstreesize) + maxkeys = Vector{K}(uninitialized, bfstreesize) for s = levstart[tdpth] : bfstreesize anc = bfstreenodes[s] c1 = t.tree[anc].child1