summaryrefslogtreecommitdiff
path: root/av.c
diff options
context:
space:
mode:
authorRuslan Zakirov <ruz@bestpractical.com>2013-02-24 16:05:51 +0400
committerFather Chrysostomos <sprout@cpan.org>2013-06-30 11:43:41 -0700
commit36925d9e116d2779c960f8cac847f9ccd4c43e53 (patch)
tree503e3638a0ae7a533c4adabbc39058df70d91a93 /av.c
parenta38ab4751f3c0df44dc09e4d685a2637e93c9778 (diff)
downloadperl-36925d9e116d2779c960f8cac847f9ccd4c43e53.tar.gz
change magic_methcall to use SV with shared hash value
Perl_magic_methcall is not public API, so there is no need to add another function and we can just change function's arguments.
Diffstat (limited to 'av.c')
-rw-r--r--av.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/av.c b/av.c
index 44b5fbc865..fb01f48a09 100644
--- a/av.c
+++ b/av.c
@@ -76,7 +76,7 @@ Perl_av_extend(pTHX_ AV *av, I32 key)
if (mg) {
SV *arg1 = sv_newmortal();
sv_setiv(arg1, (IV)(key + 1));
- Perl_magic_methcall(aTHX_ MUTABLE_SV(av), mg, "EXTEND", G_DISCARD, 1,
+ Perl_magic_methcall(aTHX_ MUTABLE_SV(av), mg, SV_CONST(EXTEND), G_DISCARD, 1,
arg1);
return;
}
@@ -561,7 +561,7 @@ Perl_av_push(pTHX_ AV *av, SV *val)
Perl_croak_no_modify();
if ((mg = SvTIED_mg((const SV *)av, PERL_MAGIC_tied))) {
- Perl_magic_methcall(aTHX_ MUTABLE_SV(av), mg, "PUSH", G_DISCARD, 1,
+ Perl_magic_methcall(aTHX_ MUTABLE_SV(av), mg, SV_CONST(PUSH), G_DISCARD, 1,
val);
return;
}
@@ -593,7 +593,7 @@ Perl_av_pop(pTHX_ AV *av)
if (SvREADONLY(av))
Perl_croak_no_modify();
if ((mg = SvTIED_mg((const SV *)av, PERL_MAGIC_tied))) {
- retval = Perl_magic_methcall(aTHX_ MUTABLE_SV(av), mg, "POP", 0, 0);
+ retval = Perl_magic_methcall(aTHX_ MUTABLE_SV(av), mg, SV_CONST(POP), 0, 0);
if (retval)
retval = newSVsv(retval);
return retval;
@@ -655,7 +655,7 @@ Perl_av_unshift(pTHX_ AV *av, I32 num)
Perl_croak_no_modify();
if ((mg = SvTIED_mg((const SV *)av, PERL_MAGIC_tied))) {
- Perl_magic_methcall(aTHX_ MUTABLE_SV(av), mg, "UNSHIFT",
+ Perl_magic_methcall(aTHX_ MUTABLE_SV(av), mg, SV_CONST(UNSHIFT),
G_DISCARD | G_UNDEF_FILL, num);
return;
}
@@ -719,7 +719,7 @@ Perl_av_shift(pTHX_ AV *av)
if (SvREADONLY(av))
Perl_croak_no_modify();
if ((mg = SvTIED_mg((const SV *)av, PERL_MAGIC_tied))) {
- retval = Perl_magic_methcall(aTHX_ MUTABLE_SV(av), mg, "SHIFT", 0, 0);
+ retval = Perl_magic_methcall(aTHX_ MUTABLE_SV(av), mg, SV_CONST(SHIFT), 0, 0);
if (retval)
retval = newSVsv(retval);
return retval;
@@ -792,7 +792,7 @@ Perl_av_fill(pTHX_ AV *av, I32 fill)
if ((mg = SvTIED_mg((const SV *)av, PERL_MAGIC_tied))) {
SV *arg1 = sv_newmortal();
sv_setiv(arg1, (IV)(fill + 1));
- Perl_magic_methcall(aTHX_ MUTABLE_SV(av), mg, "STORESIZE", G_DISCARD,
+ Perl_magic_methcall(aTHX_ MUTABLE_SV(av), mg, SV_CONST(STORESIZE), G_DISCARD,
1, arg1);
return;
}