From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 75E271F4D0 for ; Fri, 15 Nov 2024 02:59:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1731639573; bh=qnvIumdLqQUqFSCSz2fP0u+SwbEVBdOGVibjCgpJHMY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=YI/dhQGNWzjwHrUXT+9uDg/q6EIxrfkcJFa80MQbNgnM2EgsCeWpvhKFig5IVZtyN J16EKXFLyDkmsMP8jrqSZMT0+xBUuKX05bijutTAjy03dV4VMCpVJ2oRucHqvNyl9M 8Ep2yP3OC6cDHGVerI5eFYveEi+3JG6BtPfKZj4w= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 4/6] nntp: integerize {article} to save memory Date: Fri, 15 Nov 2024 02:59:30 +0000 Message-ID: <20241115025932.1647240-5-e@80x24.org> In-Reply-To: <20241115025932.1647240-1-e@80x24.org> References: <20241115025932.1647240-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: The NNTP article number is always an integer, so ensure it's stored as one to avoid malloc overhead since NNTP clients may linger for minutes at a time. --- 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 1749a755..6fa9159f 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -520,7 +520,7 @@ sub msg_body_write ($$) { sub set_art { my ($self, $art) = @_; - $self->{article} = $art if defined $art && $art =~ /\A[0-9]+\z/; + $self->{article} = $art + 0 if defined $art && $art =~ /\A[0-9]+\z/; } sub msg_hdr_write ($$) {