Skip to content

Commit

Permalink
Initialize recently introduced non-static class member lastCycles to …
Browse files Browse the repository at this point in the history
…zero in constructor

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

Also initialize beginCycles to zero for consistency and completeness.
  • Loading branch information
practicalswift committed Nov 13, 2017
1 parent 2adbddb commit 069215e
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/bench/bench.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,17 @@ namespace benchmark {
uint64_t minCycles;
uint64_t maxCycles;
public:
State(std::string _name, duration _maxElapsed) : name(_name), maxElapsed(_maxElapsed), count(0) {
minTime = duration::max();
maxTime = duration::zero();
minCycles = std::numeric_limits<uint64_t>::max();
maxCycles = std::numeric_limits<uint64_t>::min();
countMask = 1;
State(std::string _name, duration _maxElapsed) :
name(_name),
maxElapsed(_maxElapsed),
minTime(duration::max()),
maxTime(duration::zero()),
count(0),
countMask(1),
beginCycles(0),
lastCycles(0),
minCycles(std::numeric_limits<uint64_t>::max()),
maxCycles(std::numeric_limits<uint64_t>::min()) {
}
bool KeepRunning();
};
Expand Down

0 comments on commit 069215e

Please sign in to comment.