Skip to content

Commit

Permalink
Speed up searching for the timeline index of the replied-to message
Browse files Browse the repository at this point in the history
Use `Vector::focus()` with reverse iteration from the current reply
message, searching backwards since the replied-to message must come
before the reply message
  • Loading branch information
kevinaboos committed Sep 22, 2024
1 parent d98b40d commit 7388dba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/home/room_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ impl Widget for RoomScreen {
.into_iter()
.rposition(|i| i.as_event()
.and_then(|e| e.event_id())
.map_or(false, |ev_id| ev_id == details.event_id)
.is_some_and(|ev_id| ev_id == details.event_id)
);

if let Some(index) = replied_to_msg_tl_index {
Expand Down

0 comments on commit 7388dba

Please sign in to comment.