From 16e7b7c8de83d83bd3eda06002e12314de0fbc08 Mon Sep 17 00:00:00 2001 From: Val Lorentz Date: Sat, 4 Nov 2023 21:42:27 +0100 Subject: [PATCH] backlog: Actually exit the for loop once we rendered the bottom paragraph The first loop is more expensive due to computing the height before rendering... --- src/components/backlog.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/backlog.rs b/src/components/backlog.rs index 6ca73f1..f4d03dc 100644 --- a/src/components/backlog.rs +++ b/src/components/backlog.rs @@ -85,6 +85,9 @@ impl Component for Backlog { text_area.height = text_area.height.saturating_sub(height); scroll = scroll.saturating_sub(expected_height); + if scroll == 0 { + break; + } } if text_area.height == 0 { // No more room to display other paragraphs, stop now