Esempio n. 1
0
void HashDelete(unsigned key, Hash hash) {
  HashEntry tmp;
  int j = (hash->mapfunc)(key);
  HashEntry *ent = &hash->array[j];

  while (*ent && (*ent)->key != key) {
    ent = &(*ent)->next;
  }

  assert(4, *ent);

  tmp = *ent;
  *ent = (*ent)->next;
  localfree(tmp);
}
Esempio n. 2
0
void HashDelete(unsigned int key,Hash hash)
{
  HashEntry *ent;
  HashEntry tmp;
  int j;

  j = (hash->mapfunc)(key);
  for (ent=(HashEntry*__capability)&(hash->array[j]);
    CAP_VALID(*ent) &&
      (*ent)->key!=key; ent=(HashEntry*__capability)&((*ent)->next))
      ;
  assert(4,*ent);
  tmp = *ent;
  *ent = (*ent)->next;
  localfree(tmp);
}