Take iterator in calculate_hash()

Avoids unnecessary allocations.
This commit is contained in:
Lambda 2024-08-26 19:16:51 +00:00
parent cce83beedb
commit f1642c92d1
5 changed files with 24 additions and 33 deletions

View file

@ -283,10 +283,7 @@ impl Service {
services().rooms.state.get_room_shortstatehash(room_id)?;
let state_hash = utils::calculate_hash(
&new_state_ids_compressed
.iter()
.map(|bytes| &bytes[..])
.collect::<Vec<_>>(),
new_state_ids_compressed.iter().map(|bytes| &bytes[..]),
);
let (new_shortstatehash, already_existed) =