Skip to content

Commit 15071b3

Browse files
committed
minor bugs in prefix search
1 parent acbc110 commit 15071b3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/prefixsearch/binarytreeprefixsearch.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ leaves is greater than a given value.
1515
mutable struct BinaryTreePrefixSearch{T<:Real}
1616
# Data structure uses an array with children of i at 2i and 2i+1.
1717
array::Array{T,1} # length(array) > 0
18-
depth::Int64 # length(array) = 2^depth - 1
19-
offset::Int64 # 2^(depth - 1). Index of first leaf and number of leaves.
20-
cnt::Int64 # Number of leaves in use. Logical number of entries. cnt > 0.
21-
initial_allocation::Int64
18+
depth::Int # length(array) = 2^depth - 1
19+
offset::Int # 2^(depth - 1). Index of first leaf and number of leaves.
20+
cnt::Int # Number of leaves in use. Logical number of entries. cnt > 0.
21+
initial_allocation::Int
2222
end
2323

2424

@@ -201,8 +201,8 @@ Random.rand(rng::AbstractRNG, d::Random.SamplerTrivial{BinaryTreePrefixSearch{T}
201201

202202
Base.haskey(md::BinaryTreePrefixSearch, clock) = false
203203

204-
function Base.haskey(md::BinaryTreePrefixSearch{T}, clock::Int) where {T}
205-
if 0 < clock length(md)
204+
function Base.haskey(pst::BinaryTreePrefixSearch{T}, clock::Int) where {T}
205+
if 0 < clock length(pst)
206206
return getindex(pst, clock) > zero(T)
207207
else
208208
return false

0 commit comments

Comments
 (0)