From 21fcd8a37c82c1ef654d402cf592f0c9d803aa26 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 23 Jul 2022 06:13:07 +0000 Subject: [PATCH] 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. --- lib/PublicInbox/NNTP.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.44.0