1
0
Fork 0

fix cppcheck errors

This commit is contained in:
jsteemann 2017-03-06 14:22:03 +01:00
parent 885bc6186f
commit 79f6a39c23
2 changed files with 2 additions and 5 deletions

View File

@ -142,12 +142,11 @@ uint64_t Cache::usage() {
}
std::pair<double, double> Cache::hitRates() {
double lifetimeRate = std::nan("");
double windowedRate = std::nan("");
uint64_t currentMisses = _findMisses.load();
uint64_t currentHits = _findHits.load();
lifetimeRate = 100 * (static_cast<double>(currentHits) /
double lifetimeRate = 100 * (static_cast<double>(currentHits) /
static_cast<double>(currentHits + currentMisses));
if (_enableWindowedStats && _findStats.get() != nullptr) {

View File

@ -197,12 +197,10 @@ uint64_t Manager::globalAllocation() {
}
std::pair<double, double> Manager::globalHitRates() {
double lifetimeRate = std::nan("");
double windowedRate = std::nan("");
uint64_t currentMisses = _findMisses.load();
uint64_t currentHits = _findHits.load();
lifetimeRate = 100 * (static_cast<double>(currentHits) /
double lifetimeRate = 100 * (static_cast<double>(currentHits) /
static_cast<double>(currentHits + currentMisses));
if (_enableWindowedStats && _findStats.get() != nullptr) {