Changeset 12606


Ignore:
Timestamp:
Jul 31, 2011, 2:04:43 PM (12 years ago)
Author:
jordan
Message:

(trunk libT) Remove the backup implementation of tr_ptrArrayLowerBound() that was added 5 weeks ago in r12512. This was for testing in the nightlies, to use its output against the function's primary implementation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/ptrarray.c

    r12553 r12606  
    113113**/
    114114
    115 #ifndef NDEBUG
    116 static int
    117 lowerBound2( const tr_ptrArray * t,
    118              const void * ptr,
    119              int compare( const void *, const void * ),
    120              bool * exact_match )
    121 {
    122     int i;
    123     const int len = t->n_items;
    124 
    125     for( i=0; i<len; ++i )
    126     {
    127         const int c = compare( t->items[i], ptr );
    128 
    129         if( c == 0 ) {
    130             *exact_match = true;
    131             return i;
    132         }
    133 
    134         if( c < 0 )
    135             continue;
    136 
    137         *exact_match = false;
    138         return i;
    139     }
    140 
    141     *exact_match = false;
    142     return len;
    143 }
    144 #endif
    145 
    146115int
    147116tr_ptrArrayLowerBound( const tr_ptrArray  * t,
     
    152121    int pos = -1;
    153122    bool match = false;
    154 #ifndef NDEBUG
    155     bool match_2;
    156 #endif
    157123
    158124    if( t->n_items == 0 )
     
    194160    }
    195161
    196     assert( pos == lowerBound2( t, ptr, compare, &match_2 ) );
    197     assert( match == match_2 );
    198 
    199162    if( exact_match )
    200163        *exact_match = match;
     
    206169                       int compare(const void*, const void*) UNUSED )
    207170{
    208 #if 1
     171#ifndef NDEBUG
    209172    int i;
    210173
Note: See TracChangeset for help on using the changeset viewer.