Skip to content

Commit

Permalink
suggested changes by sturlamolden
Browse files Browse the repository at this point in the history
  • Loading branch information
rainwoodman committed Apr 18, 2017
1 parent 9ba5210 commit 3a7a7f5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion scipy/spatial/ckdtree.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,6 @@ cdef public class cKDTree [object ckdtree, type ckdtree_type]:
The list of k-th nearest neighbors to return. If k is an
integer it is treated as a list of [1, ... k] (range(1, k+1)).
Note that the counting starts from 1.
if k is not sorted.
eps : non-negative float
Return approximate nearest neighbors; the k-th returned value
is guaranteed to be no further than (1+eps) times the
Expand Down
2 changes: 1 addition & 1 deletion scipy/spatial/ckdtree/src/query.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ query_single_point(const ckdtree *self,

/* fill output arrays with sorted neighbors */
for (i = 0; i < nk; ++i) {
if(k[i] - 1 >= nnb) {
if(NPY_UNLIKELY(k[i] - 1 >= nnb)) {
result_indices[i] = self->n;
result_distances[i] = NPY_INFINITY;
} else {
Expand Down

0 comments on commit 3a7a7f5

Please sign in to comment.