mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
more cleanup
This commit is contained in:
parent
2b595fb329
commit
06a6a8462f
1 changed files with 1 additions and 5 deletions
|
@ -57,16 +57,12 @@ public:
|
|||
|
||||
void addSample(T sample) {
|
||||
if (numSamples > 0) {
|
||||
T lastAverage = average;
|
||||
average = (sample * WEIGHTING) + (lastAverage * ONE_MINUS_WEIGHTING);
|
||||
average = (sample * WEIGHTING) + (average * ONE_MINUS_WEIGHTING);
|
||||
} else {
|
||||
average = sample;
|
||||
}
|
||||
numSamples++;
|
||||
}
|
||||
|
||||
T getAverage() const { return average; }
|
||||
T getNumSamples() const { return numSamples; }
|
||||
};
|
||||
|
||||
template <class T, int MAX_NUM_SAMPLES> class ThreadSafeMovingAverage {
|
||||
|
|
Loading…
Reference in a new issue