/guava/android/guava/src/com/google/common/util/concurrent/SmoothRateLimiter.java
+ permitsToTime( slope - permitsAboveThresholdToTake) ;
+ permitsToTime ( availablePermitsAboveThreshold - permitsAboveThresholdToTake ) ;
double availablePermitsAboveThreshold = storedPermits - thresholdPermits; long micros = 0; if (availablePermitsAboveThreshold > 0.0) { double permitsAboveThresholdToTake = min(availablePermitsAboveThreshold, permitsToTake); double length = permitsToTime(availablePermitsAboveThreshold) <extra_id_0> micros = (long) (permitsAboveThresholdToTake * length / 2.0); permitsToTake -= permitsAboveThresholdToTake; } micros += (long) (stableIntervalMicros * permitsToTake); return micros; }