ucif/antlr3/src/antlr3collections.c
static pANTLR3_HASH_ENTRY   antlr3HashRemoveI   (pANTLR3_HASH_TABLE table, ANTLR3_INTKEY key)
{
    ANTLR3_UINT32           hash;
    pANTLR3_HASH_BUCKET     bucket;
    pANTLR3_HASH_ENTRY      entry;
    pANTLR3_HASH_ENTRY      * nextPointer;

    /* First we need to know the hash of the provided key
     */
    hash    = (ANTLR3_UINT32)(key % (ANTLR3_INTKEY)(table->modulo));

    /* Knowing the hash, we can find the bucket
     */
    bucket  = table->buckets + hash;

    /* Now, we traverse the entries in the bucket until
     * we find the key or the end of the entries in the bucket.
     * We track the element prior to the one we are examining
     * as we need to set its next pointer to the next pointer
     * of the entry we are deleting (if we find it).
     */
    entry           =   bucket->entries;    /* Entry to examine                                     */
    nextPointer     = & bucket->entries;    /* Where to put the next pointer of the deleted entry   */

    while   (entry != NULL)
    {
        /* See if this is the entry we wish to delete
         */
        if  (entry->keybase.key.iKey == key)
        {
            /* It was the correct entry, so we set the next pointer
             * of the previous entry to the next pointer of this
             * located one, which takes it out of the chain.
             */
            (*nextPointer)              = entry->nextEntry;

            table->count--;

            return entry;
        }
        else
        {
            /* We found an entry but it wasn't the one that was wanted, so
             * move to the next one, if any.
             */
            nextPointer = & (entry->nextEntry);     /* Address of the next pointer in the current entry     */
            entry       = entry->nextEntry;         /* Address of the next element in the bucket (if any)   */
        }
    }

    return NULL;  /* Not found */
}
/** Remove a numeric keyed entry from a hash table if it exists,
 *  no error if it does not exist.
 */
Remove a numeric keyed entry from a hash table if it exists,
no error if it does not exist.
Remove a numeric keyed entry from a hash table if it exists no error if it does not exist .
static pANTLR3_HASH_ENTRY   antlr3HashRemoveI   (pANTLR3_HASH_TABLE table, ANTLR3_INTKEY key)
{
    ANTLR3_UINT32           hash;
    pANTLR3_HASH_BUCKET     bucket;
    pANTLR3_HASH_ENTRY      entry;
    pANTLR3_HASH_ENTRY      * nextPointer;
    hash    = (ANTLR3_UINT32)(key % (ANTLR3_INTKEY)(table->modulo));
    bucket  = table->buckets + hash;
    entry           =   bucket->entries;    
    nextPointer     = & bucket->entries;    
    while   (entry != NULL)
    {
        if  (entry->keybase.key.iKey == key)
        {
            (*nextPointer)              = entry->nextEntry;
            table->count--;
            return entry;
        }
        else
        {
            nextPointer = & (entry->nextEntry);     
            entry       = entry->nextEntry;         
        }
    }
    return NULL;  
}
static pANTLR3_HASH_ENTRY antlr3HashRemoveI ( pANTLR3_HASH_TABLE table , ANTLR3_INTKEY key ) { ANTLR3_UINT32 hash ; pANTLR3_HASH_BUCKET bucket ; pANTLR3_HASH_ENTRY entry ; pANTLR3_HASH_ENTRY * nextPointer ; hash = ( ANTLR3_UINT32 ) ( key % ( ANTLR3_INTKEY ) ( table -> modulo ) ) ; bucket = table -> buckets + hash ; entry = bucket -> entries ; nextPointer = & bucket -> entries ; while ( entry != NULL ) { if ( entry -> keybase . key . iKey == key ) { ( * nextPointer ) = entry -> nextEntry ; table -> count -- ; return entry ; } else { nextPointer = & ( entry -> nextEntry ) ; entry = entry -> nextEntry ; } } return NULL ; }
Remove a numeric keyed entry from a hash table if it exists,
  no error if it does not exist.
Remove a numeric keyed entry from a hash table if it exists no error if it does not exist .
/* First we need to know the hash of the provided key
     */ /* Knowing the hash, we can find the bucket
     */ /* Now, we traverse the entries in the bucket until
     * we find the key or the end of the entries in the bucket.
     * We track the element prior to the one we are examining
     * as we need to set its next pointer to the next pointer
     * of the entry we are deleting (if we find it).
     */ /* Entry to examine                                     */ /* Where to put the next pointer of the deleted entry   */ /* See if this is the entry we wish to delete
         */ /* It was the correct entry, so we set the next pointer
             * of the previous entry to the next pointer of this
             * located one, which takes it out of the chain.
             */ /* We found an entry but it wasn't the one that was wanted, so
             * move to the next one, if any.
             */ /* Address of the next pointer in the current entry     */ /* Address of the next element in the bucket (if any)   */ /* Not found */