optimize auth_chain short_id to event_id translation step

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-10-01 23:19:47 +00:00 committed by strawberry
parent ab06701ed0
commit 36677bb982
3 changed files with 46 additions and 17 deletions

View file

@ -797,13 +797,13 @@ impl Service {
for state in &fork_states {
let starting_events: Vec<&EventId> = state.values().map(Borrow::borrow).collect();
let auth_chain = self
let auth_chain: HashSet<Arc<EventId>> = self
.services
.auth_chain
.event_ids_iter(room_id, &starting_events)
.get_event_ids(room_id, &starting_events)
.await?
.collect::<HashSet<Arc<EventId>>>()
.await;
.into_iter()
.collect();
auth_chain_sets.push(auth_chain);
}
@ -983,13 +983,13 @@ impl Service {
starting_events.push(id.borrow());
}
let auth_chain = self
let auth_chain: HashSet<Arc<EventId>> = self
.services
.auth_chain
.event_ids_iter(room_id, &starting_events)
.get_event_ids(room_id, &starting_events)
.await?
.collect()
.await;
.into_iter()
.collect();
auth_chain_sets.push(auth_chain);
fork_states.push(state);