Browse Source

Initialize recently introduced non-static class member lastCycles to zero in constructor

lastCycles was introduced in 3532818746 which was merged into master yesterday.

Also initialize beginCycles to zero for consistency and completeness.
0.16
practicalswift 7 years ago
parent
commit
069215ebe2
  1. 17
      src/bench/bench.h

17
src/bench/bench.h

@ -59,12 +59,17 @@ namespace benchmark {
uint64_t minCycles; uint64_t minCycles;
uint64_t maxCycles; uint64_t maxCycles;
public: public:
State(std::string _name, duration _maxElapsed) : name(_name), maxElapsed(_maxElapsed), count(0) { State(std::string _name, duration _maxElapsed) :
minTime = duration::max(); name(_name),
maxTime = duration::zero(); maxElapsed(_maxElapsed),
minCycles = std::numeric_limits<uint64_t>::max(); minTime(duration::max()),
maxCycles = std::numeric_limits<uint64_t>::min(); maxTime(duration::zero()),
countMask = 1; count(0),
countMask(1),
beginCycles(0),
lastCycles(0),
minCycles(std::numeric_limits<uint64_t>::max()),
maxCycles(std::numeric_limits<uint64_t>::min()) {
} }
bool KeepRunning(); bool KeepRunning();
}; };

Loading…
Cancel
Save