ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/CBOR-XS/XS.xs
(Generate patch)

Comparing CBOR-XS/XS.xs (file contents):
Revision 1.21 by root, Wed Nov 20 14:59:06 2013 UTC vs.
Revision 1.23 by root, Wed Nov 20 16:19:47 2013 UTC

225static void 225static void
226encode_str (enc_t *enc, int utf8, char *str, STRLEN len) 226encode_str (enc_t *enc, int utf8, char *str, STRLEN len)
227{ 227{
228 if (ecb_expect_false (enc->cbor.flags & F_DEDUP_STRINGS)) 228 if (ecb_expect_false (enc->cbor.flags & F_DEDUP_STRINGS))
229 { 229 {
230 SV **svp = hv_fetch (enc->stringref[utf8], str, len, 1); 230 SV **svp = hv_fetch (enc->stringref[!!utf8], str, len, 1);
231 231
232 if (SvOK (*svp)) 232 if (SvOK (*svp))
233 { 233 {
234 // already registered, use stringref 234 // already registered, use stringref
235 encode_tag (enc, CBOR_TAG_STRINGREF); 235 encode_tag (enc, CBOR_TAG_STRINGREF);
656decode_he (dec_t *dec, HV *hv) 656decode_he (dec_t *dec, HV *hv)
657{ 657{
658 // for speed reasons, we specialcase single-string 658 // for speed reasons, we specialcase single-string
659 // byte or utf-8 strings as keys, but only when !stringref 659 // byte or utf-8 strings as keys, but only when !stringref
660 660
661 if (expect_true (!dec->stringref)) 661 if (ecb_expect_true (!dec->stringref))
662 if (*dec->cur >= 0x40 && *dec->cur <= 0x40 + 27) 662 if (*dec->cur >= 0x40 && *dec->cur <= 0x40 + 27)
663 { 663 {
664 I32 len = decode_uint (dec); 664 I32 len = decode_uint (dec);
665 char *key = (char *)dec->cur; 665 char *key = (char *)dec->cur;
666 666

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines