From 0feccc7fee3cb8ffb27d53150835ef9fa7f7a573 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Mon, 16 Oct 2023 18:11:50 +0200 Subject: [PATCH] crypto: remove useless call to `self.cache` in Store::users_for_key_query The store cache can be filled lazily when it's actually needed. It's not needed in this function here, and may be needed in another function the caller of this function may call later. No need to preemptively fill the cache here. --- crates/matrix-sdk-crypto/src/store/mod.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/crates/matrix-sdk-crypto/src/store/mod.rs b/crates/matrix-sdk-crypto/src/store/mod.rs index 7edb632da..5ecd96d28 100644 --- a/crates/matrix-sdk-crypto/src/store/mod.rs +++ b/crates/matrix-sdk-crypto/src/store/mod.rs @@ -1168,9 +1168,6 @@ impl Store { pub(crate) async fn users_for_key_query( &self, ) -> Result<(HashSet, SequenceNumber)> { - // Make sure the tracked users set is up to date. - let _cache = self.cache().await?; - Ok(self.inner.users_for_key_query.lock().await.users_for_key_query()) }