Skip to content

Commit 2f6a8cf

Browse files
Use zero() instead of 0
1 parent 751e2a4 commit 2f6a8cf

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/kd_tree.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ function knn_kernel!(tree::KDTree{V},
195195
left_idx = getleft(index)
196196
right_idx = getright(index)
197197
# Point is to the right of the split value
198-
if split_diff > 0
198+
if split_diff > zero(split_diff)
199199
close = right_idx
200200
far = left_idx
201201
hyper_rec_far = left_region
@@ -274,7 +274,7 @@ function inrange_kernel!(
274274
left_region, right_region = split_hyperrectangle(hyper_rec, split_dim, split_val)
275275
left_idx = getleft(index)
276276
right_idx = getright(index)
277-
if split_diff > 0 # Point is to the right of the split value
277+
if split_diff > zero(split_diff) # Point is to the right of the split value
278278
close = right_idx
279279
far = left_idx
280280
hyper_rec_far = left_region
@@ -288,7 +288,7 @@ function inrange_kernel!(
288288
# Compute contributions for both close and far subtrees
289289
M = tree.metric
290290
old_contrib = max_dist_contribs[split_dim]
291-
if split_diff > 0
291+
if split_diff > zero(split_diff)
292292
# Point is to the right
293293
# Close subtree: split_val as new min, far subtree: split_val as new max
294294
new_contrib_close = get_max_distance_contribution_single(M, point[split_dim], split_val, hyper_rec.maxes[split_dim], split_dim)

0 commit comments

Comments
 (0)