From f083ef6b36fcfe5bea35427636fc8aff4e729ef6 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 24 Dec 2016 11:52:43 +0000 Subject: view: do not modify array during iteration This results in a half percent speedup or so doing $MESSAGE_ID/T/ HTML generation for a 368 message thread. --- lib/PublicInbox/View.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 97a8bcbc..39ca959c 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -476,7 +476,7 @@ sub add_text_body { } my @quot; my $l = PublicInbox::Linkify->new; - while (defined(my $cur = shift @lines)) { + foreach my $cur (@lines) { if ($cur !~ /^>/) { # show the previously buffered quote inline flush_quote(\$s, $l, \@quot) if @quot; -- cgit v1.2.3-24-ge0c7