diff options
Diffstat (limited to 'src/timedata.h')
-rw-r--r-- | src/timedata.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/timedata.h b/src/timedata.h index 9f2499c85c..111b9e0ebd 100644 --- a/src/timedata.h +++ b/src/timedata.h @@ -27,9 +27,9 @@ private: unsigned int nSize; public: - CMedianFilter(unsigned int size, T initial_value) : nSize(size) + CMedianFilter(unsigned int _size, T initial_value) : nSize(_size) { - vValues.reserve(size); + vValues.reserve(_size); vValues.push_back(initial_value); vSorted = vValues; } @@ -48,14 +48,14 @@ public: T median() const { - int size = vSorted.size(); - assert(size > 0); - if (size & 1) // Odd number of elements + int vSortedSize = vSorted.size(); + assert(vSortedSize > 0); + if (vSortedSize & 1) // Odd number of elements { - return vSorted[size / 2]; + return vSorted[vSortedSize / 2]; } else // Even number of elements { - return (vSorted[size / 2 - 1] + vSorted[size / 2]) / 2; + return (vSorted[vSortedSize / 2 - 1] + vSorted[vSortedSize / 2]) / 2; } } |