about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-01-24 22:41:57 -0800
committerEric Wong <e@80x24.org>2021-01-26 18:51:31 +0000
commit99d3f175072a8ef062ba6335a3ceb267ba89c12b (patch)
tree831aac52aeb6863be0178701aa9b3d53c5fb8023
parentaf3dfdc0416c7d9d5ad785826639744cc2cd9b9a (diff)
downloadpublic-inbox-99d3f175072a8ef062ba6335a3ceb267ba89c12b.tar.gz
It doesn't appear Perl (as of 5.32.x) has any internal
optimization for splitting on a single-byte, so give it
a regexp instead of letting it compile and discard a
new one every single time.
-rw-r--r--lib/PublicInbox/Spawn.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/Spawn.pm b/lib/PublicInbox/Spawn.pm
index 376d2190..86f66605 100644
--- a/lib/PublicInbox/Spawn.pm
+++ b/lib/PublicInbox/Spawn.pm
@@ -343,7 +343,7 @@ undef $fdpass;
 sub which ($) {
         my ($file) = @_;
         return $file if index($file, '/') >= 0;
-        foreach my $p (split(':', $ENV{PATH})) {
+        for my $p (split(/:/, $ENV{PATH})) {
                 $p .= "/$file";
                 return $p if -x $p;
         }