about summary refs log tree commit homepage
path: root/lib/PublicInbox
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-08-29 09:26:37 +0000
committerEric Wong <e@80x24.org>2022-08-29 19:05:48 +0000
commita66a2eddda8ffbb7679f4ef80dba7c7d377cda84 (patch)
treef6ed2339330000defdb2f5076d460a6b08e0118e /lib/PublicInbox
parent207031dbcffd74c8832a7e0e6952af574bc37a2e (diff)
downloadpublic-inbox-a66a2eddda8ffbb7679f4ef80dba7c7d377cda84.tar.gz
Array lookups and extra arithmetic in Perl is slower than
bumping the internal array offset inside the interpreter.
Fwiw, using: my ($level, $subj) = splice(@extra, 0, 2)
did not result in a performance improvement.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r--lib/PublicInbox/View.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 5fbdd1fa..9846fa47 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -1188,9 +1188,9 @@ sub dump_topics {
 
                 my $s = "<a\nhref=\"$href/T/$anchor\">$top_subj</a>\n" .
                         " $ds UTC $n\n";
-                for (my $i = 0; $i < scalar(@extra); $i += 2) {
-                        my $level = $extra[$i];
-                        my $subj = $extra[$i + 1]; # already normalized
+                while (@extra) {
+                        my $level = shift @extra;
+                        my $subj = shift @extra; # already normalized
                         $mid = delete $seen->{$subj};
                         my @subj = split(/ /, $subj);
                         my @next_prev = @subj; # full copy