Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transform classic loops to range-based for loops in module kdtree #2842

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 (const 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