diff options
author | Yves Orton <demerphq@gmail.com> | 2016-10-27 20:58:37 +0200 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2016-10-27 20:58:48 +0200 |
commit | 3092ee0cc2fd064f94e1ba8dc866b0ba8efc3cb8 (patch) | |
tree | 93dc5028f8f8f059db5c61293a8ade48998c1b68 /gv.c | |
parent | 055ae706a0637a77ba440aedf596d2ebac642051 (diff) | |
download | perl-3092ee0cc2fd064f94e1ba8dc866b0ba8efc3cb8.tar.gz |
optimise gv.c a bit (we could do better)
We save a few ops for package vars starting with 'E'
by checking the second char as well. We could
probably be much smarter with this switch, but we
would have to generate it, which involves its own
issues.
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -1856,10 +1856,12 @@ S_gv_magicalize(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len, if (len) { switch (*name) { case 'E': - if (memEQs(name, len, "EXPORT") + if ( + len >= 6 && name[1] == 'X' && + (memEQs(name, len, "EXPORT") ||memEQs(name, len, "EXPORT_OK") ||memEQs(name, len, "EXPORT_FAIL") - ||memEQs(name, len, "EXPORT_TAGS") + ||memEQs(name, len, "EXPORT_TAGS")) ) GvMULTI_on(gv); break; @@ -1921,10 +1923,12 @@ S_gv_magicalize(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len, } break; case 'E': - if (memEQs(name, len, "EXPORT") + if ( + len >= 6 && name[1] == 'X' && + (memEQs(name, len, "EXPORT") ||memEQs(name, len, "EXPORT_OK") ||memEQs(name, len, "EXPORT_FAIL") - ||memEQs(name, len, "EXPORT_TAGS") + ||memEQs(name, len, "EXPORT_TAGS")) ) GvMULTI_on(gv); break; |