init a few vecs in event_handler using with_capacity

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-05-16 23:54:54 -04:00 committed by June 🍓🦴
parent d49507bc21
commit e098448b9d
2 changed files with 6 additions and 6 deletions

View file

@ -163,7 +163,7 @@ pub(crate) async fn get_context_route(body: Ruma<get_context::v3::Request>) -> R
.map(|(_, pdu)| pdu.to_room_event())
.collect();
let mut state = Vec::new();
let mut state = Vec::with_capacity(state_ids.len());
for (shortstatekey, id) in state_ids {
let (event_type, state_key) = services()