Skip to content
Open
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
4 changes: 4 additions & 0 deletions src/balanced_tree.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,9 @@ function BalancedTree23{K,D,Ord}(::Val{true},
push!(m.useddatacells, lengthdata)
firsttrip = false
end
if firsttrip # no data items in tree, so return empty m.
return m
end
resize!(m.tree, 0)
height = 0
belowlevlength = lengthdata
Expand Down Expand Up @@ -1055,6 +1058,7 @@ function BalancedTree23{K,D,Ord}(::Val{true},
child_belowaddress[3], 0,
m.data[child_keyaddress[2]].k,
m.data[child_keyaddress[3]].k))

myaddress = length(m.tree)
if height == 0
replaceparent!(m.data, child_belowaddress[1], myaddress)
Expand Down
4 changes: 3 additions & 1 deletion test/test_sorted_containers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,16 @@ function testSortedDictMethods()
my_assert(typeof(m09a) == SortedDict{Int,Any,ForwardOrdering})
m09b = SortedDict([(1,2), (3,'a')]) # test issue 239
my_assert(typeof(m09a) == SortedDict{Int,Any,ForwardOrdering})

my_assert(m0 == m02)
my_assert(isequal(m0, m02))
my_assert(m1 == m01)
my_assert(isequal(m1, m01))
my_assert(m1 == m11)
my_assert(isequal(m1, m11))

m10 = union(SortedSet(), SortedSet()) # test issue 969
my_assert(length(m10) == 0)

# Test Exceptions
@test_throws ArgumentError SortedDict([1,2,3,4])
@test_throws BoundsError SortedDict{Int,Int}([1,2,3,4])
Expand Down
Loading