diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:50 +0000 |
commit | 9835e2ae736235810b4ea1c162ca5e65c547e770 (patch) | |
tree | 3fcebf40ed70e581d776a8a4c65923e8ec20e026 /vendor/prodash/src/render | |
parent | Releasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff) | |
download | rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip |
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/prodash/src/render')
-rw-r--r-- | vendor/prodash/src/render/line/draw.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/vendor/prodash/src/render/line/draw.rs b/vendor/prodash/src/render/line/draw.rs index cfd5eaae3..b45badf11 100644 --- a/vendor/prodash/src/render/line/draw.rs +++ b/vendor/prodash/src/render/line/draw.rs @@ -21,6 +21,7 @@ use crate::{ #[derive(Default)] pub struct State { tree: Vec<(progress::Key, progress::Task)>, + tree_hash: u64, messages: Vec<Message>, for_next_copy: Option<MessageCopyState>, /// The size of the message origin, tracking the terminal height so things potentially off screen don't influence width anymore. @@ -34,10 +35,6 @@ pub struct State { impl State { pub(crate) fn update_from_progress(&mut self, progress: &impl Root) -> bool { - let mut hasher = DefaultHasher::new(); - self.tree.hash(&mut hasher); - let prev_hash = hasher.finish(); - progress.sorted_snapshot(&mut self.tree); let mut hasher = DefaultHasher::new(); self.tree.hash(&mut hasher); @@ -46,7 +43,9 @@ impl State { self.for_next_copy = progress .copy_new_messages(&mut self.messages, self.for_next_copy.take()) .into(); - prev_hash != cur_hash + let changed = self.tree_hash != cur_hash; + self.tree_hash = cur_hash; + changed } pub(crate) fn clear(&mut self) { self.tree.clear(); |