diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2012-10-27 17:38:45 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2012-10-27 17:38:45 -0700 |
commit | ab2dfec2728c9ce43165b0f6ccdefdf51870a91d (patch) | |
tree | 01e6fb5af778e5aa267f04ce20c8833d1d2c10dd | |
parent | 94d722c58e4faf57188fea11a0e3e4b6bcb8c87a (diff) | |
download | abc-ab2dfec2728c9ce43165b0f6ccdefdf51870a91d.tar.gz abc-ab2dfec2728c9ce43165b0f6ccdefdf51870a91d.tar.bz2 abc-ab2dfec2728c9ce43165b0f6ccdefdf51870a91d.zip |
Improvements to LMS code.
-rw-r--r-- | src/misc/vec/vecMem.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/misc/vec/vecMem.h b/src/misc/vec/vecMem.h index 6367a272..eaa9481f 100644 --- a/src/misc/vec/vecMem.h +++ b/src/misc/vec/vecMem.h @@ -342,14 +342,13 @@ static int Vec_MemHashInsert( Vec_Mem_t * p, word * pEntry ) if ( p->nEntries > Vec_IntSize(p->vTable) ) Vec_MemHashResize( p ); pSpot = Vec_MemHashLookup( p, pEntry ); - if ( *pSpot == -1 ) - { - *pSpot = Vec_IntSize(p->vNexts); - Vec_IntPush( p->vNexts, -1 ); - Vec_MemPush( p, pEntry ); - assert( p->nEntries == Vec_IntSize(p->vNexts) ); - } - return *pSpot; + if ( *pSpot != -1 ) + return *pSpot; + *pSpot = Vec_IntSize(p->vNexts); + Vec_IntPush( p->vNexts, -1 ); + Vec_MemPush( p, pEntry ); + assert( p->nEntries == Vec_IntSize(p->vNexts) ); + return Vec_IntSize(p->vNexts) - 1; } |