Skip to content

Commit bcabf1b

Browse files
multismepoljar
authored andcommitted
Improve perfomance of build_room_key_bundle
1 parent 7767ef6 commit bcabf1b

File tree

1 file changed

+1
-4
lines changed
  • crates/matrix-sdk-crypto/src/store

1 file changed

+1
-4
lines changed

crates/matrix-sdk-crypto/src/store/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,10 +1580,7 @@ impl Store {
15801580
&self,
15811581
room_id: &RoomId,
15821582
) -> std::result::Result<RoomKeyBundle, CryptoStoreError> {
1583-
// TODO: make this WAY more efficient. We should only fetch sessions for the
1584-
// correct room.
1585-
let mut sessions = self.get_inbound_group_sessions().await?;
1586-
sessions.retain(|session| session.room_id == room_id);
1583+
let sessions = self.get_inbound_group_sessions_by_room_id(room_id).await?;
15871584

15881585
let mut bundle = RoomKeyBundle::default();
15891586
for session in sessions {

0 commit comments

Comments
 (0)