From 9f7f577df3bc056c77d63aafa26e4d21c53af0aa Mon Sep 17 00:00:00 2001 From: Matteo Casalin Date: Fri, 4 Mar 2016 23:19:09 +0100 Subject: Let find fail, instead of using a dubious upper bound check Change-Id: I874ef402d241aa4de02057ca9dc747ae0497b1e0 --- tools/source/memtools/unqidx.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'tools/source/memtools') diff --git a/tools/source/memtools/unqidx.cxx b/tools/source/memtools/unqidx.cxx index 3d60fb847a1c..ea3b773c6b79 100644 --- a/tools/source/memtools/unqidx.cxx +++ b/tools/source/memtools/unqidx.cxx @@ -48,8 +48,7 @@ UniqueIndexImpl::Index UniqueIndexImpl::Insert( void* p ) void* UniqueIndexImpl::Remove( Index nIndex ) { // Check for valid index - if ( (nIndex >= nStartIndex) && - (nIndex < (maMap.size() + nStartIndex)) ) + if ( nIndex >= nStartIndex ) { // insert index as empty entry, and reduce indexcount, // if this entry was used @@ -68,8 +67,7 @@ void* UniqueIndexImpl::Remove( Index nIndex ) void* UniqueIndexImpl::Get( Index nIndex ) const { // check for valid index - if ( (nIndex >= nStartIndex) && - (nIndex < (maMap.size() + nStartIndex)) ) + if ( nIndex >= nStartIndex ) { std::map::const_iterator it = maMap.find( nIndex - nStartIndex ); if( it != maMap.end() ) -- cgit