fix(all): fixed coverity problem
This commit is contained in:
parent
699b573b6f
commit
104e8f212a
|
@ -263,7 +263,7 @@ double tdigestQuantile(TDigest *t, double q) {
|
|||
b = c;
|
||||
right = (b->weight * a->mean + a->weight * b->mean) / (a->weight + b->weight);
|
||||
if (idx < weight_so_far + a->weight) {
|
||||
double p = (idx - weight_so_far) / (a->weight == 0) ? 1 : a->weight;
|
||||
double p = (idx - weight_so_far) / ((a->weight == 0) ? 1 : a->weight);
|
||||
return left * (1 - p) + right * p;
|
||||
}
|
||||
weight_so_far += a->weight;
|
||||
|
|
Loading…
Reference in New Issue