From 9f52932327a40a7de055515b0dc1e0d8cca51410 Mon Sep 17 00:00:00 2001 From: S6066 Date: Sun, 3 Sep 2017 18:11:28 +0000 Subject: [PATCH] Added Reserve function in Ndk::EntityList (#134) --- SDK/include/NDK/EntityList.hpp | 1 + SDK/include/NDK/EntityList.inl | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/SDK/include/NDK/EntityList.hpp b/SDK/include/NDK/EntityList.hpp index 8303f7fa4..4620837a0 100644 --- a/SDK/include/NDK/EntityList.hpp +++ b/SDK/include/NDK/EntityList.hpp @@ -35,6 +35,7 @@ namespace Ndk inline void Insert(Entity* entity); inline void Remove(Entity* entity); + inline void Reserve(std::size_t entityCount); // STL API inline iterator begin() const; diff --git a/SDK/include/NDK/EntityList.inl b/SDK/include/NDK/EntityList.inl index 8d871e2c6..0a6809a3a 100644 --- a/SDK/include/NDK/EntityList.inl +++ b/SDK/include/NDK/EntityList.inl @@ -137,6 +137,16 @@ namespace Ndk } } + /*! + * \brief Reserves enough space to contains entityCount entities + * + * \param entityCount Number of entities to reserve + */ + inline void EntityList::Reserve(std::size_t entityCount) + { + m_entityBits.Reserve(entityCount); + } + // STL Interface inline EntityList::iterator EntityList::begin() const {