summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-08-30 22:26:33 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-08-30 22:27:44 -0700
commit92cf6698b7b791604a155ab95762f0b29a351068 (patch)
treed35329bd271f93dd1e6b1c180efba634fca433ae /mg.c
parent864329c3a6aadf41283abada71c1b343e164bad3 (diff)
downloadperl-92cf6698b7b791604a155ab95762f0b29a351068.tar.gz
Stop calling get-magic twice for lvalue pos($utf8)
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/mg.c b/mg.c
index 089f9c6e26..09f9b60ea4 100644
--- a/mg.c
+++ b/mg.c
@@ -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;