Changeset 13946


Ignore:
Timestamp:
Feb 3, 2013, 9:43:17 PM (8 years ago)
Author:
jordan
Message:

(libT) remove redundancy from compareKeys()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/quark.c

    r13933 r13946  
    400400  const struct tr_key_struct * b = vb;
    401401
    402   if (a->len == b->len)
    403     {
    404       ret = memcmp (a->str, b->str, a->len);
    405     }
    406   else if (a->len < b->len)
    407     {
    408       ret = memcmp (a->str, b->str, a->len);
    409       if (!ret)
    410         ret = -1;
    411     }
    412   else /* a->len > b->len */
    413     {
    414       ret = memcmp (a->str, b->str, b->len);
    415       if (!ret)
    416         ret = 1;
    417     }
     402  ret = memcmp (a->str, b->str, a->len);
     403
     404  if (!ret && (a->len != b->len))
     405    ret = a->len < b->len ? -1 : 1;
    418406
    419407  return ret;
Note: See TracChangeset for help on using the changeset viewer.