Skip to content

Commit 25ee56c

Browse files
committed
Remove float literals
1 parent 35ac46f commit 25ee56c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/common/sum_tree.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@ function correct_sample(t::SumTree, leaf_ind)
139139
p = t.tree[leaf_ind]
140140
# walk backwards until p != 0 or until leftmost leaf reached
141141
tmp_ind = leaf_ind
142-
while p == 0f0 && (tmp_ind-1)*2 > length(t.tree)
142+
while iszero(p) && (tmp_ind-1)*2 > length(t.tree)
143143
tmp_ind -= 1
144144
p = t.tree[tmp_ind]
145145
end
146146
# walk forwards until p != 0 or until rightmost leaf reached
147-
p == 0f0 && (tmp_ind = leaf_ind)
148-
while p == 0f0 && (tmp_ind - t.nparents) <= t.length
147+
iszero(p) && (tmp_ind = leaf_ind)
148+
while iszero(p) && (tmp_ind - t.nparents) <= t.length
149149
tmp_ind += 1
150150
p = t.tree[tmp_ind]
151151
end

0 commit comments

Comments
 (0)