components/prboom/w_wad.c
//
// killough 1/31/98: Initialize lump hash table
//
killough 1/31/98: Initialize lump hash table
killough 1 / 31 / 98 : Initialize lump hash table
void W_HashLumps(void)
{
  int i;
  for (i=0; i<numlumps; i++)
    lumpinfo[i].index = -1;                     
  for (i=0; i<numlumps; i++)
    {                                           
      int j = W_LumpNameHash(lumpinfo[i].name) % (unsigned) numlumps;
      lumpinfo[i].next = lumpinfo[j].index;     
      lumpinfo[j].index = i;
    }
}
void W_HashLumps ( void ) { int i ; for ( i = 0 ; i < numlumps ; i ++ ) lumpinfo [ i ] . index = -1 ; for ( i = 0 ; i < numlumps ; i ++ ) { int j = W_LumpNameHash ( lumpinfo [ i ] . name ) % ( unsigned ) numlumps ; lumpinfo [ i ] . next = lumpinfo [ j ] . index ; lumpinfo [ j ] . index = i ; } }
killough 1/31/98: Initialize lump hash table
killough 1 / 31 / 98 : Initialize lump hash table
// mark slots empty // Insert nodes to the beginning of each chain, in first-to-last // lump order, so that the last lump of a given name appears first // in any chain, observing pwad ordering rules. killough // hash function: // Prepend to list