diff options
author | Ruslan Zakirov <ruz@bestpractical.com> | 2012-10-06 02:30:18 +0400 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-10-08 08:49:54 -0700 |
commit | 0ddecb91901742e7df780394170d4bf818ee1da8 (patch) | |
tree | 9ec6ec8a75f93ab815b88599e204fd9527f2af4e /hv.c | |
parent | 5f9d7e2b943ef7f67920d8093a33505fca8ff930 (diff) | |
download | perl-0ddecb91901742e7df780394170d4bf818ee1da8.tar.gz |
there is no obvious reason not to set flags
I don't see any reason not to set flags properly in this
branch. It doesn't look like any useful optimization.
It's probably even a bug, but probably it can only be hit from
a XS code. To hit the bug keysv should be provided, be UTF8
and not SvIsCOW_shared_hash, but with flags containing
HVhek_KEYCANONICAL.
Diffstat (limited to 'hv.c')
-rw-r--r-- | hv.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -388,7 +388,7 @@ Perl_hv_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen, if (SvIsCOW_shared_hash(keysv)) { flags = HVhek_KEYCANONICAL | (is_utf8 ? HVhek_UTF8 : 0); } else { - flags = 0; + flags = is_utf8 ? HVhek_UTF8 : 0; } } else { is_utf8 = ((flags & HVhek_UTF8) ? TRUE : FALSE); @@ -396,8 +396,7 @@ Perl_hv_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen, if (action & HV_DELETE) { return (void *) hv_delete_common(hv, keysv, key, klen, - flags | (is_utf8 ? HVhek_UTF8 : 0), - action, hash); + flags, action, hash); } xhv = (XPVHV*)SvANY(hv); |