Skip to content

Commit 3dfe1b8

Browse files
committed
classify: Modernize function UniformDensity
This should fix an issue reported by Codacy. Signed-off-by: Stefan Weil <sw@weilnetz.de>
1 parent 72c8741 commit 3dfe1b8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/classify/cluster.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -1829,12 +1829,13 @@ static double NormalDensity(int32_t x) {
18291829
* @return The value of the uniform distribution at x.
18301830
*/
18311831
static double UniformDensity(int32_t x) {
1832-
static double UniformDistributionDensity = 1.0 / BUCKETTABLESIZE;
1832+
constexpr auto UniformDistributionDensity = 1.0 / BUCKETTABLESIZE;
18331833

1834-
if ((x >= 0.0) && (x <= BUCKETTABLESIZE))
1834+
if ((x >= 0) && (x <= BUCKETTABLESIZE)) {
18351835
return UniformDistributionDensity;
1836-
else
1836+
} else {
18371837
return 0.0;
1838+
}
18381839
} // UniformDensity
18391840

18401841
/**

0 commit comments

Comments
 (0)