diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-06-14 17:52:46 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-06-14 17:52:46 +0200 |
commit | 571f0e8653a532c34edde36e797ecba446978b1c (patch) | |
tree | 18d660b59511c06bf87d4f66ad66c2645444c147 /mg.c | |
parent | 41e07bbccec49c484a622d86a1ba01136a740d9f (diff) | |
download | perl-571f0e8653a532c34edde36e797ecba446978b1c.tar.gz |
pos in lvalue context now returns a PVMG instead of a PVLV.
Store the target SV in mg_obj, instead of LvTARG(). This slightly reduces both
code complexity and runtime memory use.
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -2064,10 +2064,9 @@ int Perl_magic_getpos(pTHX_ SV *sv, MAGIC *mg) { dVAR; - SV* const lsv = LvTARG(sv); + SV *const lsv = mg->mg_obj; PERL_ARGS_ASSERT_MAGIC_GETPOS; - PERL_UNUSED_ARG(mg); if (SvTYPE(lsv) >= SVt_PVMG && SvMAGIC(lsv)) { MAGIC * const found = mg_find(lsv, PERL_MAGIC_regex_global); @@ -2087,14 +2086,13 @@ int Perl_magic_setpos(pTHX_ SV *sv, MAGIC *mg) { dVAR; - SV* const lsv = LvTARG(sv); + SV *const lsv = mg->mg_obj; SSize_t pos; STRLEN len; STRLEN ulen = 0; MAGIC* found; PERL_ARGS_ASSERT_MAGIC_SETPOS; - PERL_UNUSED_ARG(mg); if (SvTYPE(lsv) >= SVt_PVMG && SvMAGIC(lsv)) found = mg_find(lsv, PERL_MAGIC_regex_global); |