From 4fef904295e07dc9d0a144a4e6fc5bfb59c80fb9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 10 Sep 2022 08:16:59 +0000 Subject: [PATCH] www_listing: consolidate some ->zmore dispatches `.' concatenation is still faster for small strings, but passing an array to ->zmore is more efficient for large search results and full listings. --- lib/PublicInbox/WwwListing.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/PublicInbox/WwwListing.pm b/lib/PublicInbox/WwwListing.pm index 79c0a8ec..0ab41452 100644 --- a/lib/PublicInbox/WwwListing.pm +++ b/lib/PublicInbox/WwwListing.pm @@ -223,13 +223,12 @@ sub psgi_triple { @$list = map { $_->[1] } sort { $b->[0] <=> $a->[0] } @$list; } - $gzf->zmore('
');
-		$gzf->zmore(join("\n", @$list));
+		$gzf->zmore('
', join("\n", @$list)); # big
 		$gzf->zmore(mset_footer($ctx, $mset)) if $mset;
 	} elsif (my $mset = delete $ctx->{-mset}) {
-		$gzf->zmore(mset_nav_top($ctx, $mset));
-		$gzf->zmore('
no matching inboxes');
-		$gzf->zmore(mset_footer($ctx, $mset));
+		$gzf->zmore(mset_nav_top($ctx, $mset) .
+				'
no matching inboxes' .
+				mset_footer($ctx, $mset));
 	} else {
 		$gzf->zmore('
no inboxes, yet');
 	}
-- 
2.44.0