further optimize presence_since iteration

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-10-22 03:28:45 +00:00 committed by strawberry
parent c06f560913
commit 0e0438e1f9
5 changed files with 23 additions and 17 deletions

View file

@ -488,7 +488,7 @@ async fn process_presence_updates(
if !services
.rooms
.state_cache
.user_sees_user(syncing_user, &user_id)
.user_sees_user(syncing_user, user_id)
.await
{
continue;
@ -496,10 +496,10 @@ async fn process_presence_updates(
let presence_event = services
.presence
.from_json_bytes_to_event(&presence_bytes, &user_id)
.from_json_bytes_to_event(presence_bytes, user_id)
.await?;
match presence_updates.entry(user_id) {
match presence_updates.entry(user_id.into()) {
Entry::Vacant(slot) => {
slot.insert(presence_event);
},
@ -524,7 +524,7 @@ async fn process_presence_updates(
.currently_active
.or(curr_content.currently_active);
},
}
};
}
Ok(())