Permalink
Browse files

Fixed off-by-one error in counter wraparound.

  • Loading branch information...
Michael S. Fischer
Michael S. Fischer committed Jul 6, 2011
1 parent 5672088 commit d709fa7f1cb806f36ceb4d307901ab6dab3d9192
Showing with 1 addition and 1 deletion.
  1. +1 −1 metrics/counter.js
View
@@ -17,7 +17,7 @@ Counter.prototype.inc = function(val) {
this.count += val;
// Wrap counter if necessary.
if (this.count > MAX_COUNTER_VALUE) {
- this.count -= MAX_COUNTER_VALUE;
+ this.count -= (MAX_COUNTER_VALUE + 1);
}
}

0 comments on commit d709fa7

Please sign in to comment.