From: Eric Wong Date: Wed, 27 Jan 2021 09:42:22 +0000 (-0600) Subject: eml: favor index() over regexp match X-Git-Tag: v1.7.0~1288 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=eb7fd8fdd59862b5ddea07f1a4bc9a946245ad14;p=public-inbox.git 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. --- 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