Skip to content

Commit

Permalink
use std::stable_sort intead of std::sort to attempt to preserve ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
hobu committed Feb 5, 2014
1 parent 65e1370 commit 601292f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/filters/Chipper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,15 @@ void Chipper::Load( PointBuffer& buffer,


// Sort xvec and assign other index in yvec to sorted indices in xvec.
std::sort(xvec.begin(), xvec.end());
std::stable_sort(xvec.begin(), xvec.end());
for (boost::uint32_t i = 0; i < xvec.size(); ++i)
{
idx = xvec[i].m_ptindex;
yvec[idx].m_oindex = i;
}

// Sort yvec.
std::sort(yvec.begin(), yvec.end());
std::stable_sort(yvec.begin(), yvec.end());

//Iterate through the yvector, setting the xvector appropriately.
for (boost::uint32_t i = 0; i < yvec.size(); ++i)
Expand Down

0 comments on commit 601292f

Please sign in to comment.