summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-06-14 17:52:46 +0200
committerNicholas Clark <nick@ccl4.org>2011-06-14 17:52:46 +0200
commit571f0e8653a532c34edde36e797ecba446978b1c (patch)
tree18d660b59511c06bf87d4f66ad66c2645444c147 /mg.c
parent41e07bbccec49c484a622d86a1ba01136a740d9f (diff)
downloadperl-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.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/mg.c b/mg.c
index 1bdf5c4cda..64c7d2085f 100644
--- a/mg.c
+++ b/mg.c
@@ -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);