Dev/pvs studio cleanups2 (#2877)

* a round of cleanups courtesy of PVS studio

* add a test to make sure that a warning is a false alarm

* bug fix

* Fix a UFF bug

* more PVS studio cleanups

* next round of PVS studio cleanups

* completely remove the chances for that bug

* changes in response to review

* add an additional test
+ a bit of reformatting that snuck in
This commit is contained in:
Greg Landrum
2020-01-22 15:10:58 +01:00
committed by GitHub
parent d9124a8556
commit ec366c1ab7
52 changed files with 1063 additions and 1024 deletions

View File

@@ -480,11 +480,8 @@ double DiceSimilarity(const SparseIntVect<IndexType> &v1,
v2Sum = v2.getTotalVal(true);
double denom = v1Sum + v2Sum;
if (fabs(denom) < 1e-6) {
if (returnDistance) {
return 1.0;
} else {
return 0.0;
}
// no need to worry about returnDistance here
return 0.0;
}
double minV = v1Sum < v2Sum ? v1Sum : v2Sum;
if (2. * minV / denom < bounds) {