diff options
author | Maxim Pimenov <m@maps.me> | 2019-09-06 17:51:14 +0300 |
---|---|---|
committer | Tatiana Yan <tatiana.kondakova@gmail.com> | 2019-09-09 13:52:29 +0300 |
commit | 640198a2d543fed90d3e95d0fbcbe62b631494e6 (patch) | |
tree | 3f6a34fee9f9b6ab9edc8d048c276bfec70984d9 /drape | |
parent | 86fad33ed83ee6320e78614601e5387759e8d249 (diff) |
[base] Removed unused functions; minor refactoring.
Diffstat (limited to 'drape')
-rw-r--r-- | drape/batcher_helpers.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drape/batcher_helpers.cpp b/drape/batcher_helpers.cpp index fa86e4a2d6..28a2c55c8c 100644 --- a/drape/batcher_helpers.cpp +++ b/drape/batcher_helpers.cpp @@ -12,6 +12,16 @@ namespace dp { namespace { +template <typename T> +T CyclicClamp(T const x, T const xmin, T const xmax) +{ + if (x > xmax) + return xmin; + if (x < xmin) + return xmax; + return x; +} + bool IsEnoughMemory(uint32_t avVertex, uint32_t existVertex, uint32_t avIndex, uint32_t existIndex) { return avVertex >= existVertex && avIndex >= existIndex; @@ -60,7 +70,7 @@ protected: int16_t GetCWNormalizer() { int16_t tmp = m_minStripCounter; - m_minStripCounter = static_cast<uint8_t>(base::cyclicClamp(m_minStripCounter + 1, 0, 5)); + m_minStripCounter = static_cast<uint8_t>(CyclicClamp(m_minStripCounter + 1, 0, 5)); switch (tmp) { case 4: return 1; |