From: Eric Wong Date: Wed, 30 Sep 2015 21:00:18 +0000 (+0000) Subject: nntp: reduce syscalls for LIST OVERVIEW.FMT X-Git-Tag: v1.0.0~822 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=ebf564bad83e0c160b5088c7aaa9862d47735226;p=public-inbox.git nntp: reduce syscalls for LIST OVERVIEW.FMT No point in sending such a short, bounded response with multiple syscalls. --- diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index faa75634..dc4227ec 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -24,7 +24,7 @@ use constant { sub now () { clock_gettime(CLOCK_MONOTONIC) }; my @OVERVIEW = qw(Subject From Date Message-ID References Bytes Lines); -my %OVERVIEW = map { $_ => 1 } @OVERVIEW; +my $OVERVIEW_FMT = join(":\r\n", @OVERVIEW) . ":\r\n"; # disable commands with easy DoS potential: # LISTGROUP could get pretty bad, too... @@ -90,9 +90,9 @@ sub cmd_xgtitle ($;$) { '.' } -sub list_overview_fmt ($$) { +sub list_overview_fmt ($) { my ($self) = @_; - more($self, $_ . ':') foreach @OVERVIEW; + do_more($self, $OVERVIEW_FMT); } sub list_active ($;$) {