Skip to content

Commit

Permalink
Fix inefficient code
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 7, 2017
1 parent a43abec commit f3d53b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/symbology-ng/qgsgraduatedsymbolrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f3d53b8

Please sign in to comment.