Skip to content

Commit

Permalink
chore(ui): Rename variables.
Browse files Browse the repository at this point in the history
This is not a timestamp but a regular stamp. Make it clear with the
variable names.
  • Loading branch information
Hywan committed Sep 3, 2024
1 parent 49252b5 commit a737421
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions crates/matrix-sdk-ui/src/room_list_service/sorters/recency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ where
// as shallow clones of each others. In practice it's really great: a `Room` can
// never be outdated. However, for the case of sorting rooms, it breaks the
// search algorithm. `left` and `right` will have the exact same recency
// timestamp, so `left` and `right` will always be `Ordering::Equal`. This is
// stamp, so `left` and `right` will always be `Ordering::Equal`. This is
// wrong: if `left` is compared with `right` and if they are both the same room,
// it means that one of them (either `left`, or `right`, it's not important) has
// received an update. The room position is very likely to change. But if they
Expand All @@ -50,9 +50,7 @@ where
}

match (self.recency_stamps)(left, right) {
(Some(left_timestamp), Some(right_timestamp)) => {
left_timestamp.cmp(&right_timestamp).reverse()
}
(Some(left_stamp), Some(right_stamp)) => left_stamp.cmp(&right_stamp).reverse(),

(Some(_), None) => Ordering::Less,

Expand Down

0 comments on commit a737421

Please sign in to comment.