diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2016-02-16 16:19:26 +0100 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2016-02-16 16:19:26 +0100 |
commit | 7b6d74bd403f5bb0e4c8ba451eefa13193e7ed34 (patch) | |
tree | 0567e0f182be8f1545ad1423b6c99eb650baa7d2 /include/astra | |
parent | 8cfe13a410a051e5a6b9835e3a4cd6c808cf5d29 (diff) | |
download | astra-7b6d74bd403f5bb0e4c8ba451eefa13193e7ed34.tar.gz astra-7b6d74bd403f5bb0e4c8ba451eefa13193e7ed34.tar.bz2 astra-7b6d74bd403f5bb0e4c8ba451eefa13193e7ed34.tar.xz astra-7b6d74bd403f5bb0e4c8ba451eefa13193e7ed34.zip |
Slightly simplify CAstraObjectManager::remove
Diffstat (limited to 'include/astra')
-rw-r--r-- | include/astra/AstraObjectManager.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/astra/AstraObjectManager.h b/include/astra/AstraObjectManager.h index 35b4534..ad89c2a 100644 --- a/include/astra/AstraObjectManager.h +++ b/include/astra/AstraObjectManager.h @@ -216,11 +216,10 @@ T* CAstraObjectManager<T>::get(int _iIndex) const template <typename T> void CAstraObjectManager<T>::remove(int _iIndex) { - if (!hasIndex(_iIndex)) { - return; - } // find data typename map<int,T*>::iterator it = m_mIndexToObject.find(_iIndex); + if (it == m_mIndexToObject.end()) + return; // delete data delete (*it).second; // delete from map |