From f96f7b6ea04ec649c9ae5ff2afb918035bf2fc8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Mon, 19 Mar 2018 22:33:49 -0700 Subject: [PATCH] Cleanup. --- src/bgfx_p.h | 50 ++++++++++++++++++++------------------------------ 1 file changed, 20 insertions(+), 30 deletions(-) diff --git a/src/bgfx_p.h b/src/bgfx_p.h index 6db0823a2..a23e1489b 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -165,40 +165,30 @@ namespace tinystl class list : public vector { public: - void push_front(const T& _value); - void pop_front(); + void push_front(const T& _value) + { + this->insert(this->begin(), _value); + } - void sort(); + void pop_front() + { + this->erase(this->begin() ); + } - private: - vector m_vector; + void sort() + { + bx::quickSort( + this->begin() + , uint32_t(this->end() - this->begin() ) + , sizeof(T) + , [](const void* _a, const void* _b) -> int32_t { + const T& lhs = *(const T*)(_a); + const T& rhs = *(const T*)(_b); + return lhs < rhs ? -1 : 1; + }); + } }; - template - inline void list::push_front(const T& _value) - { - this->insert(this->begin(), _value); - } - - template - inline void list::pop_front() - { - this->erase(this->begin() ); - } - - template - inline void list::sort() - { - bx::quickSort( - this->begin() - , uint32_t(this->end() - this->begin() ) - , sizeof(T) - , [](const void* _a, const void* _b) -> int32_t { - const T& lhs = *(const T*)(_a); - const T& rhs = *(const T*)(_b); - return lhs < rhs; - }); - } } // namespace tinystl namespace stl = tinystl;