Skip to content

Commit

Permalink
Fix NaN comparison error.
Browse files Browse the repository at this point in the history
  • Loading branch information
ojw28 committed Jul 7, 2014
1 parent 43b7efa commit f1213a7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ public synchronized void onTransferEnd() {
float bytesPerSecond = accumulator * 1000 / elapsedMs;
slidingPercentile.addSample(computeWeight(accumulator), bytesPerSecond);
float bandwidthEstimateFloat = slidingPercentile.getPercentile(0.5f);
bandwidthEstimate = bandwidthEstimateFloat == Float.NaN
? NO_ESTIMATE : (long) bandwidthEstimateFloat;
bandwidthEstimate = Float.isNaN(bandwidthEstimateFloat) ? NO_ESTIMATE
: (long) bandwidthEstimateFloat;
notifyBandwidthSample(elapsedMs, accumulator, bandwidthEstimate);
}
streamCount--;
Expand Down

0 comments on commit f1213a7

Please sign in to comment.