Skip to content

Commit

Permalink
feat(base): Faster Store::rooms_filtered.
Browse files Browse the repository at this point in the history
Just like in matrix-org#3552,
this patch updates `Store::rooms_filtered` to not call `Store::room` so
that it doesn't lock `rooms` for each item, thus making it way faster.
  • Loading branch information
Hywan committed Jun 13, 2024
1 parent 81e328d commit adff893
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/matrix-sdk-base/src/store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ impl Store {
.read()
.unwrap()
.iter()
.filter(|(_, r)| filter.matches(r.state()))
.filter_map(|(id, _)| self.get_room(id))
.filter(|(_, room)| filter.matches(room.state()))
.map(|(_, room)| room.clone())
.collect()
}

Expand Down

0 comments on commit adff893

Please sign in to comment.