summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2017-11-02 14:03:40 -0600
committerKarl Williamson <khw@cpan.org>2017-11-06 12:50:06 -0700
commit0f12654f40cf107e9bddf1bd2acf7f0e41068be5 (patch)
tree2b16729ca896219b0981d200bd252359382abebb /gv.c
parentbdb7e3f0f6e41516d2c50d43e5f3f1373db014b0 (diff)
downloadperl-0f12654f40cf107e9bddf1bd2acf7f0e41068be5.tar.gz
Change some strBEGINs() to memBEGINs()
The latter is generally faster when the length is already known. This commit also changes a few hard-coded numbers to use sizeof().
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gv.c b/gv.c
index 60b8c7d77a..bdad262c22 100644
--- a/gv.c
+++ b/gv.c
@@ -1073,8 +1073,9 @@ Perl_gv_fetchmethod_pvn_flags(pTHX_ HV *stash, const char *name, const STRLEN le
DEBUG_o( Perl_deb(aTHX_ "Treating %s as %s::%s\n",
origname, HvENAME_get(stash), name) );
}
- else if ( sep_len >= 7 &&
- strBEGINs(last_separator - 7, "::SUPER")) {
+ else if (memBEGINs(last_separator - sizeof("::SUPER") - 1,
+ sep_len, "::SUPER"))
+ {
/* don't autovifify if ->NoSuchStash::SUPER::method */
stash = gv_stashpvn(origname, sep_len - 7, is_utf8);
if (stash) flags |= GV_SUPER;