Skip to content
Permalink
Browse files

Fix inefficient code

  • Loading branch information
nyalldawson committed Feb 7, 2017
1 parent a43abec commit f3d53b8de9933035b3c5beb5dcdc48401e89f719
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/core/symbology-ng/qgsgraduatedsymbolrenderer.cpp
@@ -828,9 +828,9 @@ void QgsGraduatedSymbolRenderer::updateClasses( QgsVectorLayer* vlayer, Mode mod
if ( !ok || values.isEmpty() )
return;

std::sort( values.begin(), values.end() ); // vmora: is wondering if O( n log(n) ) is really necessary here, min and max are O( n )
minimum = values.first();
maximum = values.last();
auto result = std::minmax_element( values.begin(), values.end() );
minimum = *result.first;
maximum = *result.second;
valuesLoaded = true;
}
else

0 comments on commit f3d53b8

Please sign in to comment.
You can’t perform that action at this time.