From: Eric Wong Date: Fri, 15 Nov 2024 02:59:30 +0000 (+0000) Subject: nntp: integerize {article} to save memory X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f33ea8718ffdbb42be0efdf2de7b74f06bbd577;p=thirdparty%2Fpublic-inbox.git nntp: integerize {article} to save memory 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. --- diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index 1749a7552..6fa9159fe 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 ($$) {