include/comphelper/parallelsort.hxx | 1 + 1 file changed, 1 insertion(+)
New commits: commit fd78b325894bf7dc8c300949dcd822a97c2c8f1c Author: Caolán McNamara <[email protected]> AuthorDate: Mon Aug 26 10:13:29 2024 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Wed Aug 28 13:12:59 2024 +0200 cid#1606736 silence Overflowed constant Change-Id: Iedad6ed6e21c6ead9bb923bcb319122a834763f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172513 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/include/comphelper/parallelsort.hxx b/include/comphelper/parallelsort.hxx index 032165f06f0c..fd7bb83b1686 100644 --- a/include/comphelper/parallelsort.hxx +++ b/include/comphelper/parallelsort.hxx @@ -300,6 +300,7 @@ void s3sort(const RandItr aBegin, const RandItr aEnd, Compare aComp = Compare(), auto pOut = std::make_unique<ValueType[]>(nLen); const size_t nBins = lcl_round_down_pow2(nThreadCount); + assert(nBins >= 1); const size_t nOverSamplingFactor = std::max(1.0, std::sqrt(static_cast<double>(nLen) / 64)); const size_t nSamples = nOverSamplingFactor * nBins; auto aSamples = std::make_unique<ValueType[]>(nSamples);
