mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-24 16:48:52 -04:00
crypto: Improve memory overhead of export_room_keys by using Vec::retain
Signed-off-by: Andy Balaam <andy.balaam@matrix.org>
This commit is contained in:
@@ -1830,13 +1830,9 @@ impl OlmMachine {
|
||||
) -> StoreResult<Vec<ExportedRoomKey>> {
|
||||
let mut exported = Vec::new();
|
||||
|
||||
let sessions: Vec<InboundGroupSession> = self
|
||||
.store()
|
||||
.get_inbound_group_sessions()
|
||||
.await?
|
||||
.into_iter()
|
||||
.filter(|s| predicate(s))
|
||||
.collect();
|
||||
let mut sessions = self.store().get_inbound_group_sessions().await?;
|
||||
|
||||
sessions.retain(|s| predicate(s));
|
||||
|
||||
for session in sessions {
|
||||
let export = session.export().await;
|
||||
|
||||
Reference in New Issue
Block a user