diff options
Diffstat (limited to 'tools/source/memtools/unqidx.cxx')
-rw-r--r-- | tools/source/memtools/unqidx.cxx | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/tools/source/memtools/unqidx.cxx b/tools/source/memtools/unqidx.cxx index ea3b773c6b79..7d7ac85314ac 100644 --- a/tools/source/memtools/unqidx.cxx +++ b/tools/source/memtools/unqidx.cxx @@ -26,9 +26,7 @@ UniqueIndexImpl::Index UniqueIndexImpl::Insert( void* p ) return IndexNotFound; // Expend array if full - Index nTmp = static_cast<Index>(maMap.size()); - if( nTmp == nCount ) - nTmp++; + const Index nTmp = static_cast<Index>(maMap.size()) + 1; // Avoid overflow of UniqIndex upon deletion nUniqIndex = nUniqIndex % nTmp; @@ -40,7 +38,6 @@ UniqueIndexImpl::Index UniqueIndexImpl::Insert( void* p ) // Insert object to array maMap[ nUniqIndex ] = p; - nCount++; nUniqIndex++; return ( nUniqIndex + nStartIndex - 1 ); } @@ -57,7 +54,6 @@ void* UniqueIndexImpl::Remove( Index nIndex ) { void* p = it->second; maMap.erase( it ); - nCount--; return p; } } |