From 7b6d74bd403f5bb0e4c8ba451eefa13193e7ed34 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 16 Feb 2016 16:19:26 +0100 Subject: Slightly simplify CAstraObjectManager::remove --- include/astra/AstraObjectManager.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include/astra') 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::get(int _iIndex) const template void CAstraObjectManager::remove(int _iIndex) { - if (!hasIndex(_iIndex)) { - return; - } // find data typename map::iterator it = m_mIndexToObject.find(_iIndex); + if (it == m_mIndexToObject.end()) + return; // delete data delete (*it).second; // delete from map -- cgit v1.2.3