summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2017-10-31 08:30:38 -0600
committerKarl Williamson <khw@cpan.org>2017-11-06 12:50:05 -0700
commitb59bf0b2884b21b6f3ce5eca607ab7a6096d87f5 (patch)
tree8f7f056070732c24842887baa1d18b6a54a9f7d1 /scope.c
parentc8b388b0c776dab4a28db03739aff4d64daccada (diff)
downloadperl-b59bf0b2884b21b6f3ce5eca607ab7a6096d87f5.tar.gz
Use memEQs, memNEs in core files
Where the length is known, we can use these functions which relieve the programmer and the program reader from having to count characters. The memFOO functions should also be slightly faster than the strFOO equivalents. In some instances in this commit, hard coded numbers are used. These come from the 'case' statement values that apply to them.
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/scope.c b/scope.c
index 7da26a48fe..3fef7a2326 100644
--- a/scope.c
+++ b/scope.c
@@ -349,7 +349,7 @@ Perl_save_gp(pTHX_ GV *gv, I32 empty)
bool isa_changed = 0;
if (stash && HvENAME(stash)) {
- if (GvNAMELEN(gv) == 3 && strnEQ(GvNAME(gv), "ISA", 3))
+ if (memEQs(GvNAME(gv), GvNAMELEN(gv), "ISA"))
isa_changed = TRUE;
else if (GvCVu(gv))
/* taking a method out of circulation ("local")*/
@@ -1091,9 +1091,7 @@ Perl_leave_scope(pTHX_ I32 base)
gp_free(a0.any_gv);
GvGP_set(a0.any_gv, (GP*)a1.any_ptr);
if ((hv=GvSTASH(a0.any_gv)) && HvENAME_get(hv)) {
- if ( GvNAMELEN(a0.any_gv) == 3
- && strnEQ(GvNAME(a0.any_gv), "ISA", 3)
- )
+ if (memEQs(GvNAME(a0.any_gv), GvNAMELEN(a0.any_gv), "ISA"))
mro_isa_changed_in(hv);
else if (had_method || GvCVu(a0.any_gv))
/* putting a method back into circulation ("local")*/