diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2016-03-04 23:19:09 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2016-03-05 11:32:11 +0100 |
commit | 9f7f577df3bc056c77d63aafa26e4d21c53af0aa (patch) | |
tree | dacdecb9794ab1114080bff1ae61aeb1b0c9cad1 /tools | |
parent | 1d4914e9e5cad4f443a742a34862620143176dbc (diff) |
Let find fail, instead of using a dubious upper bound check
Change-Id: I874ef402d241aa4de02057ca9dc747ae0497b1e0
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/memtools/unqidx.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
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<Index, void*>::const_iterator it = maMap.find( nIndex - nStartIndex ); if( it != maMap.end() ) |