abc/src/bdd/cudd/cuddLevelQ.c
/**Function********************************************************************

  Synopsis    [Removes an item from the hash table of a level queue.]

  Description [Removes an item from the hash table of a level queue.
  Nothing is done if the item is not in the table.]

  SideEffects [None]

  SeeAlso     [cuddLevelQueueDequeue hashInsert]

******************************************************************************/
Function
Synopsis    [Removes an item from the hash table of a level queue.]

Description [Removes an item from the hash table of a level queue.
Nothing is done if the item is not in the table.]




Function Synopsis [ Removes an item from the hash table of a level queue . ] Description [ Removes an item from the hash table of a level queue . Nothing is done if the item is not in the table . ]
static void
hashDelete(
  DdLevelQueue * queue,
  DdQueueItem * item)
{
    int posn;
    DdQueueItem *prevItem;
    posn = lqHash(item->key,queue->shift);
    prevItem = queue->buckets[posn];
    if (prevItem == NULL) return;
    if (prevItem == item) {
        queue->buckets[posn] = prevItem->cnext;
        return;
    }
    while (prevItem->cnext != NULL) {
        if (prevItem->cnext == item) {
            prevItem->cnext = item->cnext;
            return;
        }
        prevItem = prevItem->cnext;
    }
    return;
}
static void hashDelete ( DdLevelQueue * queue , DdQueueItem * item ) { int posn ; DdQueueItem * prevItem ; posn = lqHash ( item -> key , queue -> shift ) ; prevItem = queue -> buckets [ posn ] ; if ( prevItem == NULL ) return ; if ( prevItem == item ) { queue -> buckets [ posn ] = prevItem -> cnext ; return ; } while ( prevItem -> cnext != NULL ) { if ( prevItem -> cnext == item ) { prevItem -> cnext = item -> cnext ; return ; } prevItem = prevItem -> cnext ; } return ; }
Function
Synopsis    [Removes an item from the hash table of a level queue.]
Function Synopsis [ Removes an item from the hash table of a level queue . ]