Commit b6a16e18 for tesseract
commit b6a16e1800ff63a599bfdd2ed33e4a08221b9534
Author: Stefan Weil <sw@weilnetz.de>
Date: Sun Jun 21 14:10:58 2026 +0200
Try to fix Codacy warning
Signed-off-by: Stefan Weil <sw@weilnetz.de>
diff --git a/src/classify/cluster.cpp b/src/classify/cluster.cpp
index adce2135..dea167e1 100644
--- a/src/classify/cluster.cpp
+++ b/src/classify/cluster.cpp
@@ -2658,7 +2658,6 @@ static BUCKETS *MakeBuckets(DISTRIBUTION Distribution, uint32_t SampleCount, dou
double LastProbDensity;
double ProbDensity;
uint16_t CurrentBucket;
- bool Symmetrical;
// allocate memory needed for data structure
auto Buckets = new BUCKETS(OptimumNumberOfBuckets(SampleCount));
@@ -2668,11 +2667,11 @@ static BUCKETS *MakeBuckets(DISTRIBUTION Distribution, uint32_t SampleCount, dou
// initialize simple fields
Buckets->Distribution = Distribution;
- // all currently defined distributions are symmetrical
- Symmetrical = true;
Buckets->ChiSquared =
ComputeChiSquared(DegreesOfFreedom(Distribution, Buckets->NumberOfBuckets), Confidence);
+ // all currently defined distributions are symmetrical
+ constexpr bool Symmetrical = true;
if (Symmetrical) {
// allocate buckets so that all have approx. equal probability
BucketProbability = 1.0 / static_cast<double>(Buckets->NumberOfBuckets);