Skip to content

Commit

Permalink
Transform classic loops to range-based for loops in module kdtree
Browse files Browse the repository at this point in the history
Changes are based on the result of run-clang-tidy -header-filter='.*' -checks='-*,modernize-loop-convert' -fix
  • Loading branch information
Heiko Thiel committed Feb 9, 2019
1 parent 1cb184d commit 3d3ccb5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kdtree/include/pcl/kdtree/impl/kdtree_flann.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,16 +279,16 @@ pcl::KdTreeFLANN<PointT, Dist>::convertCloudToArray (const PointCloud &cloud, co
// But we can not guarantee that => identity_mapping_ = false
identity_mapping_ = false;

for (std::vector<int>::const_iterator iIt = indices.begin (); iIt != indices.end (); ++iIt)
for (int index : indices)
{
// Check if the point is invalid
if (!point_representation_->isValid (cloud.points[*iIt]))
if (!point_representation_->isValid (cloud.points[index]))
continue;

// map from 0 - N -> indices [0] - indices [N]
index_mapping_.push_back (*iIt); // If the returned index should be for the indices vector
index_mapping_.push_back (index); // If the returned index should be for the indices vector

point_representation_->vectorize (cloud.points[*iIt], cloud_ptr);
point_representation_->vectorize (cloud.points[index], cloud_ptr);
cloud_ptr += dim_;
}
}
Expand Down

0 comments on commit 3d3ccb5

Please sign in to comment.