Permalink
Browse files

Add a safety check.

Change-Id: Id8a6a7ef31bd98c7559de79e7aba660dd1618ed6
  • Loading branch information...
1 parent 37aeb8b commit 37dd3dfe3becc3cefb5eb37ecaa012105756cd46 @tsuna tsuna committed Jul 22, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/core/SpanGroup.java
@@ -754,6 +754,9 @@ public double nextDoubleValue() {
? Double.longBitsToDouble(values[prev])
: values[prev]);
final long x1 = timestamps[prev] & TIME_MASK;
+ assert x0 > x1: ("Next timestamp (" + x0 + ") is supposed to be "
+ + " strictly greater than the previous one (" + x1 + "), but it's"
+ + " not. this=" + this);
final double r = (y0 - y1) / (x0 - x1);
//LOG.debug("Rate for " + y1 + " @ " + x1
// + " -> " + y0 + " @ " + x0 + " => " + r);

0 comments on commit 37dd3df

Please sign in to comment.