Ignore:
Timestamp:
Dec 22, 2008, 5:35:10 PM (13 years ago)
Author:
charles
Message:

(trunk libT) remove unused functions tr_list_insert_sorted(), tr_list_foreach(). make tr_list_find_data() private.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/list.c

    r7404 r7467  
    7878}
    7979
    80 void
    81 tr_list_insert_sorted( tr_list            ** list,
    82                        void                * data,
    83                        TrListCompareFunc     compare )
    84 {
    85     /* find l, the node that we'll insert this data before */
    86     tr_list * l;
    87 
    88     for( l = *list; l != NULL; l = l->next )
    89     {
    90         const int c = (compare)( data, l->data );
    91         if( c <= 0 )
    92             break;
    93     }
    94 
    95     if( l == NULL )
    96         tr_list_append( list, data );
    97     else if( l == *list )
    98         tr_list_prepend( list, data );
    99     else
    100     {
    101         tr_list * node = node_alloc( );
    102         node->data = data;
    103         if( l->prev ){ node->prev = l->prev; node->prev->next = node; }
    104         node->next = l;
    105         l->prev = node;
    106     }
    107 }
    108 
    109 tr_list*
     80static tr_list*
    11081tr_list_find_data( tr_list *    list,
    11182                   const void * data )
     
    174145}
    175146
    176 void
    177 tr_list_foreach( tr_list *         list,
    178                  TrListForeachFunc func )
    179 {
    180     while( list )
    181     {
    182         func( list->data );
    183         list = list->next;
    184     }
    185 }
    186 
    187147int
    188148tr_list_size( const tr_list * list )
Note: See TracChangeset for help on using the changeset viewer.