diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-08-30 22:26:33 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-08-30 22:27:44 -0700 |
commit | 92cf6698b7b791604a155ab95762f0b29a351068 (patch) | |
tree | d35329bd271f93dd1e6b1c180efba634fca433ae /mg.c | |
parent | 864329c3a6aadf41283abada71c1b343e164bad3 (diff) | |
download | perl-92cf6698b7b791604a155ab95762f0b29a351068.tar.gz |
Stop calling get-magic twice for lvalue pos($utf8)
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -2166,7 +2166,7 @@ Perl_magic_setpos(pTHX_ SV *sv, MAGIC *mg) pos = SvIV(sv); if (DO_UTF8(lsv)) { - ulen = sv_len_utf8(lsv); + ulen = sv_len_utf8_nomg(lsv); if (ulen) len = ulen; } @@ -2180,9 +2180,7 @@ Perl_magic_setpos(pTHX_ SV *sv, MAGIC *mg) pos = len; if (ulen) { - I32 p = pos; - sv_pos_u2b(lsv, &p, 0); - pos = p; + pos = sv_pos_u2b_flags(lsv, pos, 0, 0); } found->mg_len = pos; |