Skip to content

Commit

Permalink
Fix VS warning for casting int to float or double (#85)
Browse files Browse the repository at this point in the history
* Fix VS warning for casting int to float or double

* Fix whitespaces
  • Loading branch information
J-Light authored and jlblancoc committed Jun 19, 2018
1 parent 4f983a7 commit dc9c0bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/nanoflann.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,8 @@ namespace nanoflann
float epsError = 1 + searchParams.eps;

distance_vector_t dists; // fixed or variable-sized container (depending on DIM)
assign(dists, (DIM > 0 ? DIM : BaseClassRef::dim), 0); // Fill it with zeros.
auto zero = static_cast<decltype(result.worstDist())>(0);
assign(dists, (DIM > 0 ? DIM : BaseClassRef::dim), zero); // Fill it with zeros.
DistanceType distsq = this->computeInitialDistances(*this, vec, dists);
searchLevel(result, vec, BaseClassRef::root_node, distsq, dists, epsError); // "count_leaf" parameter removed since was neither used nor returned to the user.
return result.full();
Expand Down

0 comments on commit dc9c0bd

Please sign in to comment.