mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 07:41:23 +01:00
Take iterator in calculate_hash()
Avoids unnecessary allocations.
This commit is contained in:
parent
cce83beedb
commit
f1642c92d1
5 changed files with 24 additions and 33 deletions
|
|
@ -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) =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue