Changeset 13712


Ignore:
Timestamp:
Dec 28, 2012, 11:46:34 PM (8 years ago)
Author:
jordan
Message:

(trunk, libT) #5201 'tr_variantDict can be much faster' -- don't test to see if each dictionary value that's a string is a quark... it almost never is, so the lookup isn't worth it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/variant.c

    r13687 r13712  
    118118                              int                         len)
    119119{
    120   tr_quark quark;
    121120  tr_variant_string_clear (str);
    122121
     
    126125    len = strlen (bytes);
    127126
    128   if (tr_quark_lookup (bytes, len, &quark))
    129     {
    130       str->type = TR_STRING_TYPE_QUARK;
    131       str->quark = quark;
    132       str->str.str = tr_quark_get_string (quark, &str->len);
    133     }
    134   else if ((size_t)len < sizeof(str->str.buf))
     127  if ((size_t)len < sizeof(str->str.buf))
    135128    {
    136129      str->type = TR_STRING_TYPE_BUF;
Note: See TracChangeset for help on using the changeset viewer.