From: Paul Hänsch Date: Mon, 24 Apr 2023 18:14:24 +0000 (+0200) Subject: quicker discard of unpaged items X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=38db3c5fe89c2bad97a0f10677a99d79c6509d2e;p=serve0 quicker discard of unpaged items --- diff --git a/list.sh b/list.sh index dd5c83d..8df5b6e 100755 --- a/list.sh +++ b/list.sh @@ -160,13 +160,15 @@ list_paginate() { printf '[div .itemlist ' while :; do - c=$((c + 1)) - if [ $c -gt $page -a $c -le $end ]; then + if [ $c -lt $page ]; then + read -r discard || break + elif [ $c -ge $end ]; then + c=$((c + $(wc -l) )) + else read_meta || break list_item - else - read -r discard || break fi + c=$((c + 1)) done printf ']'