Skip to content

Commit

Permalink
Remove stable sort
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Romain committed Jul 8, 2024
1 parent bbd3eff commit 6a66de3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inst/include/lidR/Octree.h
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ inline void Octree::harvest_knn(Node::Ocnode* node, Bucket::KnnBucket& bucket, u
double d[8];
std::vector<unsigned char> idx = {0,1,2,3,4,5,6,7};
for(auto i : idx) d[i] = distance(&heap[node->firstChild + i], bucket.pref);
std::stable_sort(idx.begin(), idx.end(), [&d](size_t i1, size_t i2) {return d[i1] < d[i2];});
std::sort(idx.begin(), idx.end(), [&d](size_t i1, size_t i2) {return d[i1] < d[i2];});

for(auto i : idx)
{
Expand Down

0 comments on commit 6a66de3

Please sign in to comment.