refactor to iterator inputs for auth_chain/short batch functions

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-11-22 12:25:46 +00:00
parent 5da42fb859
commit 3789d60b6a
10 changed files with 76 additions and 71 deletions

View file

@ -35,12 +35,12 @@ pub async fn resolve_state(
let fork_states = [current_state_ids, incoming_state];
let mut auth_chain_sets = Vec::with_capacity(fork_states.len());
for state in &fork_states {
let starting_events: Vec<&EventId> = state.values().map(Borrow::borrow).collect();
let starting_events = state.values().map(Borrow::borrow);
let auth_chain: HashSet<Arc<EventId>> = self
.services
.auth_chain
.get_event_ids(room_id, &starting_events)
.get_event_ids(room_id, starting_events)
.await?
.into_iter()
.collect();

View file

@ -139,7 +139,7 @@ pub(super) async fn state_at_incoming_resolved(
let auth_chain: HashSet<Arc<EventId>> = self
.services
.auth_chain
.get_event_ids(room_id, &starting_events)
.get_event_ids(room_id, starting_events.into_iter())
.await?
.into_iter()
.collect();