optimize sha256 interface gather/vector inputs

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-11-15 22:20:28 +00:00
parent 14e3b242df
commit 887ae84f1e
7 changed files with 85 additions and 50 deletions

View file

@ -157,12 +157,7 @@ impl Service {
let previous_shortstatehash = self.get_room_shortstatehash(room_id).await;
let state_hash = calculate_hash(
&state_ids_compressed
.iter()
.map(|s| &s[..])
.collect::<Vec<_>>(),
);
let state_hash = calculate_hash(state_ids_compressed.iter().map(|s| &s[..]));
let (shortstatehash, already_existed) = self
.services