diff options
author | Karl Williamson <khw@cpan.org> | 2017-11-02 14:03:40 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2017-11-06 12:50:06 -0700 |
commit | 0f12654f40cf107e9bddf1bd2acf7f0e41068be5 (patch) | |
tree | 2b16729ca896219b0981d200bd252359382abebb /gv.c | |
parent | bdb7e3f0f6e41516d2c50d43e5f3f1373db014b0 (diff) | |
download | perl-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.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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; |