From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 283AC1F54E for ; Sat, 23 Jul 2022 06:13:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1658556787; bh=gGenrQ0BhlMOUqfUlH2iWQqUWqPKgvkjn/WoiGP4190=; h=From:To:Subject:Date:From; b=43eTpH6NVkq/XFkAeFp44hoI7b6UyNqedTAD/XMPnfDlwpHAGHK12Qs7Bz6fK8qel 2spVBQ7ayDwELQEF4Yxq8b4pxc+tCQtHdRrKlQ55jY/Lt8WSiIbyCewh+euYAeuSrC 18gFCjBFWXZm4nLDz6tqCC0gJg8F+eegdNlKEcc4= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] nntp: use substr to check for trailing CRLF Date: Sat, 23 Jul 2022 06:13:07 +0000 Message-Id: <20220723061307.3776996-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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); }