diff --git a/src/shapevl/Collector.cpp b/src/shapevl/Collector.cpp index 071fed9..f75e940 100644 --- a/src/shapevl/Collector.cpp +++ b/src/shapevl/Collector.cpp @@ -394,6 +394,8 @@ std::map Collector::getStats() { if (_distDiffs.size()) { auto i = _distDiffs.begin() + _distDiffs.size() / 2; + + // std::nth_element makes a partial sort of the first n elements std::nth_element(_distDiffs.begin(), i, _distDiffs.end()); stats["median-dist-diff"] = *i;