Commit ab2dfec2 by Alan Mishchenko

Improvements to LMS code.

parent 94d722c5
...@@ -342,14 +342,13 @@ static int Vec_MemHashInsert( Vec_Mem_t * p, word * pEntry ) ...@@ -342,14 +342,13 @@ static int Vec_MemHashInsert( Vec_Mem_t * p, word * pEntry )
if ( p->nEntries > Vec_IntSize(p->vTable) ) if ( p->nEntries > Vec_IntSize(p->vTable) )
Vec_MemHashResize( p ); Vec_MemHashResize( p );
pSpot = Vec_MemHashLookup( p, pEntry ); pSpot = Vec_MemHashLookup( p, pEntry );
if ( *pSpot == -1 ) if ( *pSpot != -1 )
{ return *pSpot;
*pSpot = Vec_IntSize(p->vNexts); *pSpot = Vec_IntSize(p->vNexts);
Vec_IntPush( p->vNexts, -1 ); Vec_IntPush( p->vNexts, -1 );
Vec_MemPush( p, pEntry ); Vec_MemPush( p, pEntry );
assert( p->nEntries == Vec_IntSize(p->vNexts) ); assert( p->nEntries == Vec_IntSize(p->vNexts) );
} return Vec_IntSize(p->vNexts) - 1;
return *pSpot;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment