commit 46f0028c6413ca50100c33dac0c58f1502fd1f1b from: Stefan Sperling date: Thu Jan 24 19:41:39 2019 UTC tog: simplify loop condition in tree_scroll_down() commit - 0032ca7199dad2b8f41cd8e30ce889dfe3575fa6 commit + 46f0028c6413ca50100c33dac0c58f1502fd1f1b blob - 43dcf33d46407efd9b9e03a6b93cc8bcc40791a0 blob + fa7abedb4541b8446726f1c107a62cfd22825f5a --- tog/tog.c +++ tog/tog.c @@ -3046,10 +3046,8 @@ tree_scroll_down(struct got_tree_entry **first_display next = SIMPLEQ_NEXT(*first_displayed_entry, entry); else next = SIMPLEQ_FIRST(&entries->head); - while (next) { + while (next && n++ < maxscroll) { *first_displayed_entry = next; - if (++n >= maxscroll) - break; next = SIMPLEQ_NEXT(next, entry); } }