From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 42DDB20756 for ; Sat, 24 Dec 2016 11:52:46 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 3/4] view: do not modify array during iteration Date: Sat, 24 Dec 2016 11:52:43 +0000 Message-Id: <20161224115244.15402-4-e@80x24.org> In-Reply-To: <20161224115244.15402-1-e@80x24.org> References: <20161224115244.15402-1-e@80x24.org> List-Id: 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(-) diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 97a8bcb..39ca959 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; -- EW