Changeset 13636


Ignore:
Timestamp:
Dec 9, 2012, 6:24:57 PM (9 years ago)
Author:
jordan
Message:

in bitfield.c's countRange() function, make walk_end an invariant

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/bitfield.c

    r13625 r13636  
    9191      size_t i;
    9292      uint8_t val;
     93      const size_t walk_end = MIN (b->alloc_count, last_byte);
    9394
    9495      /* first byte */
     
    100101
    101102      /* middle bytes */
    102       for (i=first_byte+1; i<b->alloc_count && i<last_byte; ++i)
     103      for (i=first_byte+1; i<walk_end; ++i)
    103104        ret += trueBitCount[b->bits[i]];
    104105
Note: See TracChangeset for help on using the changeset viewer.