]> granicus.if.org Git - transmission/commitdiff
(trunk, libT) #5201 'tr_variantDict can be much faster' -- don't test to see if each...
authorJordan Lee <jordan@transmissionbt.com>
Fri, 28 Dec 2012 23:46:34 +0000 (23:46 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Fri, 28 Dec 2012 23:46:34 +0000 (23:46 +0000)
libtransmission/variant.c

index 3b7d340390c7e407fcfd46580c765e0725f3d7b7..b7e58d5070eb33fccf269c6970c58fee273b7127 100644 (file)
@@ -117,7 +117,6 @@ tr_variant_string_set_string (struct tr_variant_string  * str,
                               const char                * bytes,
                               int                         len)
 {
-  tr_quark quark;
   tr_variant_string_clear (str);
 
   if (bytes == NULL)
@@ -125,13 +124,7 @@ tr_variant_string_set_string (struct tr_variant_string  * str,
   else if (len < 0)
     len = strlen (bytes);
 
-  if (tr_quark_lookup (bytes, len, &quark))
-    {
-      str->type = TR_STRING_TYPE_QUARK;
-      str->quark = quark;
-      str->str.str = tr_quark_get_string (quark, &str->len);
-    }
-  else if ((size_t)len < sizeof(str->str.buf))
+  if ((size_t)len < sizeof(str->str.buf))
     {
       str->type = TR_STRING_TYPE_BUF;
       memcpy (str->str.buf, bytes, len);