~ubuntu-branches/ubuntu/trusty/ehcache/trusty

« back to all changes in this revision

Viewing changes to src/main/java/net/sf/ehcache/util/ratestatistics/AbstractRateStatistic.java

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bourg
  • Date: 2013-05-06 14:53:07 UTC
  • mfrom: (1.1.7) (2.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20130506145307-v5bhw5yu70re00l3
Tags: 2.6.7-1
* Team upload.
* New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
 
 *  Copyright 2003-2010 Terracotta, Inc.
 
2
 *  Copyright Terracotta, Inc.
3
3
 *
4
4
 *  Licensed under the Apache License, Version 2.0 (the "License");
5
5
 *  you may not use this file except in compliance with the License.
58
58
     * @return weighted average
59
59
     */
60
60
    float iterateMovingAverage(float nowValue, long now, float thenAverage, long then) {
61
 
        if (getRateAveragePeriod() == 0 || Float.isNaN(thenAverage)) {
 
61
        if (getRateAveragePeriod() == 0) {
62
62
            return nowValue;
63
63
        } else {
64
64
            float alpha = (float) alpha(now, then);