Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix an off-by-one in invalidating metrics.

  • Loading branch information...
commit 1de0e1351678167d4b635c310c74b5c5f8f7398d 1 parent b819bac
@mbostock mbostock authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/cube/event.js
View
3  lib/cube/event.js
@@ -106,7 +106,8 @@ exports.putter = function(db) {
var tierTimes = timesToInvalidateByTier[tier],
tierTime = tiers[tier].floor(time),
i = bisect(tierTimes, tierTime);
- if (tierTimes[i] > tierTime) tierTimes.splice(i, 0, tierTime);
+ if (i >= tierTimes.length) tierTimes.push(tierTime);
+ else if (tierTimes[i] > tierTime) tierTimes.splice(i, 0, tierTime);
}
} else {
timesToInvalidateByTier = timesToInvalidateByTierByType[type] = {};
Please sign in to comment.
Something went wrong with that request. Please try again.