Replaced repeated calculation with local variable.
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@1075 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
d617910699
commit
ac54d187bc
1 changed files with 5 additions and 4 deletions
|
@ -943,18 +943,19 @@ bool FixedAllocator::Deallocate( void * p, Chunk * hint )
|
|||
assert( CountEmptyChunks() < 2 );
|
||||
|
||||
Chunk * foundChunk = nullptr;
|
||||
if ( ( nullptr != hint ) && ( hint->HasBlock( p, numBlocks_ * blockSize_ ) ) )
|
||||
const ::std::size_t chunkLength = numBlocks_ * blockSize_;
|
||||
if ( ( nullptr != hint ) && ( hint->HasBlock( p, chunkLength ) ) )
|
||||
foundChunk = hint;
|
||||
else if ( deallocChunk_->HasBlock( p, numBlocks_ * blockSize_ ) )
|
||||
else if ( deallocChunk_->HasBlock( p, chunkLength ) )
|
||||
foundChunk = deallocChunk_;
|
||||
else if ( allocChunk_->HasBlock( p, numBlocks_ * blockSize_ ) )
|
||||
else if ( allocChunk_->HasBlock( p, chunkLength ) )
|
||||
foundChunk = allocChunk_;
|
||||
else
|
||||
foundChunk = VicinityFind( p );
|
||||
if ( nullptr == foundChunk )
|
||||
return false;
|
||||
|
||||
assert( foundChunk->HasBlock( p, numBlocks_ * blockSize_ ) );
|
||||
assert( foundChunk->HasBlock( p, chunkLength ) );
|
||||
#ifdef LOKI_CHECK_FOR_CORRUPTION
|
||||
if ( foundChunk->IsCorrupt( numBlocks_, blockSize_, true ) )
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue