We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35ac46f commit 25ee56cCopy full SHA for 25ee56c
src/common/sum_tree.jl
@@ -139,13 +139,13 @@ function correct_sample(t::SumTree, leaf_ind)
139
p = t.tree[leaf_ind]
140
# walk backwards until p != 0 or until leftmost leaf reached
141
tmp_ind = leaf_ind
142
- while p == 0f0 && (tmp_ind-1)*2 > length(t.tree)
+ while iszero(p) && (tmp_ind-1)*2 > length(t.tree)
143
tmp_ind -= 1
144
p = t.tree[tmp_ind]
145
end
146
# 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
+ iszero(p) && (tmp_ind = leaf_ind)
+ while iszero(p) && (tmp_ind - t.nparents) <= t.length
149
tmp_ind += 1
150
151
0 commit comments