summaryrefslogtreecommitdiff
path: root/pp_ctl.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 /pp_ctl.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 'pp_ctl.c')
-rw-r--r--pp_ctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index ee96688df4..967614a587 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3849,7 +3849,7 @@ S_require_file(pTHX_ SV *sv)
directory, or (*nix) hidden filenames. Also sanity check
that the generated filename ends .pm */
if (!path_searchable || len < 3 || name[0] == '.'
- || !memEQ(name + package_len, ".pm", 3))
+ || !memEQs(name + package_len, len - package_len, ".pm"))
DIE(aTHX_ "Bareword in require maps to disallowed filename \"%" SVf "\"", sv);
if (memchr(name, 0, package_len)) {
/* diag_listed_as: Bareword in require contains "%s" */