mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-08 07:56:55 -04:00
feat(sdk): Simplify code by using std::cmp::min.
This commit is contained in:
@@ -1426,9 +1426,7 @@ impl SlidingSyncViewRequestGenerator {
|
||||
| InnerSlidingSyncViewRequestGenerator::GrowingFullSync {
|
||||
position, live, limit, ..
|
||||
} => {
|
||||
let max = limit
|
||||
.map(|limit| if limit > max_index { max_index } else { limit })
|
||||
.unwrap_or(max_index);
|
||||
let max = limit.map(|limit| std::cmp::min(limit, max_index)).unwrap_or(max_index);
|
||||
trace!(end, max, name = self.view.name, "updating state");
|
||||
if end >= max {
|
||||
trace!(name = self.view.name, "going live");
|
||||
|
||||
Reference in New Issue
Block a user