From eb7fd8fdd59862b5ddea07f1a4bc9a946245ad14 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 27 Jan 2021 03:42:22 -0600 Subject: eml: favor index() over regexp match Where applicable, index() is faster than entering the regexp engine and we favor it in several other places, as well. --- lib/PublicInbox/Eml.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/Eml.pm') diff --git a/lib/PublicInbox/Eml.pm b/lib/PublicInbox/Eml.pm index 462d51fc..bd27f19b 100644 --- a/lib/PublicInbox/Eml.pm +++ b/lib/PublicInbox/Eml.pm @@ -217,7 +217,7 @@ sub mp_descend ($$) { # There's also a case where quoted text showed up in the # preamble # <20060515162817.65F0F1BBAE@citi.umich.edu> - unshift(@parts, new_sub(undef, \$pre)) if $pre =~ /:/s; + unshift(@parts, new_sub(undef, \$pre)) if index($pre, ':') >= 0; return \@parts; } # "multipart", but no boundary found, treat as single part -- cgit v1.2.3-24-ge0c7