From b8c5f58826070b2c2ff2a3a9675a1318c5f49977 Mon Sep 17 00:00:00 2001 From: Guillaume Bittoun Date: Sun, 13 Jul 2014 13:27:10 +0000 Subject: [PATCH] arraynd: Removing useless method ComputeTotalSize. --- src/lol/math/arraynd.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/lol/math/arraynd.h b/src/lol/math/arraynd.h index cac48e41..5c5c78f5 100644 --- a/src/lol/math/arraynd.h +++ b/src/lol/math/arraynd.h @@ -189,26 +189,21 @@ public: return proxy(this, m_sizes, pos, m_sizes[0]); } - inline size_t ComputeTotalSize(vec_t sizes) + /* Resize the array. + * FIXME: data gets scrambled; should we care? */ + inline void SetSize(vec_t sizes, element_t e = element_t()) { size_t total_size = 1; for (auto size : sizes) total_size *= size; - return total_size; - } - - /* Resize the array. - * FIXME: data gets scrambled; should we care? */ - inline void SetSize(vec_t sizes, element_t e = element_t()) - { - this->Resize(ComputeTotalSize(sizes), e); + this->Resize(total_size, e); } inline vec_t GetSize() const { - return ComputeTotalSize(this->m_sizes); + return this->m_sizes; } public: