Update AggregateFunctionMaxIntersections.h

This commit is contained in:
alexey-milovidov 2018-07-16 19:04:35 +03:00 committed by GitHub
parent 218a282f88
commit d1eac37389
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -137,10 +137,8 @@ public:
/// const_cast because we will sort the array
auto & array = const_cast<typename MaxIntersectionsData<PointType>::Array &>(this->data(place).value);
std::sort(array.begin(), array.end(), [](const auto & a, const auto & b) {
return (a.first < b.first) || //sort by position ascending
((a.first == b.first) && (a.second < b.second)); //sort by weight ascending
});
/// Sort by position; for equal position, sort by weight to get deterministic result.
std::sort(array.begin(), array.end());
for (const auto & point_weight : array)
{