]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
nntp: integerize {article} to save memory
authorEric Wong <e@80x24.org>
Fri, 15 Nov 2024 02:59:30 +0000 (02:59 +0000)
committerEric Wong <e@80x24.org>
Fri, 15 Nov 2024 20:27:43 +0000 (20:27 +0000)
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

index 1749a7552efa45b84019782dfae742ad0d16e44a..6fa9159feb4c3c1dcef0b6ae94f144e33a51d9ae 100644 (file)
@@ -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 ($$) {