Skip to content

Commit

Permalink
Assert that what might look like a possible division by zero is actua…
Browse files Browse the repository at this point in the history
…lly unreachable
  • Loading branch information
practicalswift committed Feb 2, 2017
1 parent 02e5308 commit db07f91
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/bench/bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ bool benchmark::State::KeepRunning()

--count;

assert(count != 0 && "count == 0 => (now == 0 && beginTime == 0) => return above");

// Output results
double average = (now-beginTime)/count;
int64_t averageCycles = (nowCycles-beginCycles)/count;
Expand Down

0 comments on commit db07f91

Please sign in to comment.