From 1bbef0d1bc52396245e22a22cf09541a01448fdb Mon Sep 17 00:00:00 2001 From: "Peter J. Holzer" Date: Tue, 20 Mar 2018 19:56:45 +0100 Subject: [PATCH] Compute buttons only once $q->self_url is surprisingly slow, so don't call it gratuitously. --- index.cgi | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/index.cgi b/index.cgi index e6f4872..f06f459 100755 --- a/index.cgi +++ b/index.cgi @@ -280,18 +280,19 @@ sub print_itemlist { $html .= "
\n"; $html .= "" . $item->{item_id} . "\n"; $html .= "" . strftime('%Y-%m-%d %H:%M:%S', localtime($item->{issued})) . "\n"; + my $mark_read_button = ""; + my $mark_later_button = ""; unless ($is_read) { - print_log("print_itemlist: \$q1=" . $q1->self_url . " (in loop)"); - $html .= "\n"; - $html .= "\n"; + $mark_read_button = "\n"; + $mark_later_button = "\n"; } + $html .= $mark_read_button; + $html .= $mark_later_button; $html .= "
" . $q->escapeHTML($item->{feed_title}) . "
\n"; $html .= "

" . $q->escapeHTML($item->{item_title}) . "

\n"; $html .= "
" . $scrubbed_content . "
\n"; - unless ($is_read) { - $html .= "\n"; - $html .= "\n"; - } + $html .= $mark_read_button; + $html .= $mark_later_button; $html .= "
\n"; $html .= ""; print $html;