Skip to content
Permalink
Browse files

Natural Breaks (Jenks) classification causes crash (#42618)

  • Loading branch information
tomass authored and github-actions committed Apr 4, 2021
1 parent 3fea7b6 commit c33bb817f46669ef6d643ef265211ea7f5b36ac7
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/core/classification/qgsclassificationjenks.cpp
@@ -99,10 +99,11 @@ QList<double> QgsClassificationJenks::calculateBreaks( double &minimum, double &

#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
double r = QRandomGenerator::global()->generate();
int j = std::floor( r / QRandomGenerator::max() * ( values.size() - 1 ) );
#else
double r = qrand();
#endif
int j = std::floor( r / RAND_MAX * ( values.size() - 1 ) );
#endif
sample[ i ] = values[ j ];
}
}

0 comments on commit c33bb81

Please sign in to comment.