engine/source/scriptlib/List.c
/* removes the last element from the index list
   only use on fully indexed list */
removes the last element from the index list
only use on fully indexed list
removes the last element from the index list only use on fully indexed list
void List_RemoveLastIndex(List *list)
{
#ifdef DEBUG
    chklist((List *)list);
#endif
    unsigned char h;
    assert(list->last);
    assert(list->current);
    assert(list->current == list->last);
    h = ptrhash(list->last->value);
    assert(list->mindices[h]);
    assert(list->mindices[h]->used > 0);
    list->mindices[h]->used--; 
    list->mindices[h]->nodes[list->mindices[h]->used] = NULL;
    list->mindices[h]->indices[list->mindices[h]->used] = 0;
}
void List_RemoveLastIndex ( List * list ) { #ifdef DEBUG chklist ( ( List * ) list ) ; #endif unsigned char h ; assert ( list -> last ) ; assert ( list -> current ) ; assert ( list -> current == list -> last ) ; h = ptrhash ( list -> last -> value ) ; assert ( list -> mindices [ h ] ) ; assert ( list -> mindices [ h ] -> used > 0 ) ; list -> mindices [ h ] -> used -- ; list -> mindices [ h ] -> nodes [ list -> mindices [ h ] -> used ] = NULL ; list -> mindices [ h ] -> indices [ list -> mindices [ h ] -> used ] = 0 ; }
removes the last element from the index list
only use on fully indexed list
removes the last element from the index list only use on fully indexed list
// it would be wrong to do this to a random element, but it's ok for the last one, since it was added as last