Mercurial > hg > svcore
diff base/MagnitudeRange.h @ 1429:48e9f538e6e9
Untabify
author | Chris Cannam |
---|---|
date | Thu, 01 Mar 2018 18:02:22 +0000 |
parents | 4d0d94ba2ea7 |
children | bbfb5a1e4b84 |
line wrap: on
line diff
--- a/base/MagnitudeRange.h Thu Mar 01 14:43:40 2018 +0000 +++ b/base/MagnitudeRange.h Thu Mar 01 18:02:22 2018 +0000 @@ -29,7 +29,7 @@ MagnitudeRange(float min, float max) : m_min(min), m_max(max) { } bool operator==(const MagnitudeRange &r) { - return r.m_min == m_min && r.m_max == m_max; + return r.m_min == m_min && r.m_max == m_max; } bool operator!=(const MagnitudeRange &r) { return !(*this == r); @@ -37,20 +37,20 @@ bool isSet() const { return (m_min != 0.f || m_max != 0.f); } void set(float min, float max) { - m_min = min; - m_max = max; - if (m_max < m_min) m_max = m_min; + m_min = min; + m_max = max; + if (m_max < m_min) m_max = m_min; } bool sample(float f) { - bool changed = false; - if (isSet()) { - if (f < m_min) { m_min = f; changed = true; } - if (f > m_max) { m_max = f; changed = true; } - } else { - m_max = m_min = f; - changed = true; - } - return changed; + bool changed = false; + if (isSet()) { + if (f < m_min) { m_min = f; changed = true; } + if (f > m_max) { m_max = f; changed = true; } + } else { + m_max = m_min = f; + changed = true; + } + return changed; } bool sample(const std::vector<float> &ff) { bool changed = false; @@ -62,16 +62,16 @@ return changed; } bool sample(const MagnitudeRange &r) { - bool changed = false; - if (isSet()) { - if (r.m_min < m_min) { m_min = r.m_min; changed = true; } - if (r.m_max > m_max) { m_max = r.m_max; changed = true; } - } else { - m_min = r.m_min; - m_max = r.m_max; - changed = true; - } - return changed; + bool changed = false; + if (isSet()) { + if (r.m_min < m_min) { m_min = r.m_min; changed = true; } + if (r.m_max > m_max) { m_max = r.m_max; changed = true; } + } else { + m_min = r.m_min; + m_max = r.m_max; + changed = true; + } + return changed; } float getMin() const { return m_min; } float getMax() const { return m_max; }