From: Eric Wong Date: Sat, 23 Jul 2022 06:13:07 +0000 (+0000) Subject: nntp: use substr to check for trailing CRLF X-Git-Tag: v1.9.0~79 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=21fcd8a37c82c1ef654d402cf592f0c9d803aa26 nntp: use substr to check for trailing CRLF Regexps consume more CPU cycles and memory, and aren't necessary here since we just converted the entire buffer to CRLF. --- diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index 8ad7adc1..b223eb07 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -502,7 +502,7 @@ sub msg_body_write ($$) { # these can momentarily double the memory consumption :< $$msg =~ s/^\./../smg; $$msg =~ s/(?msg_more($$msg); }