state-res: Remove unnecessary cloning
This commit is contained in:
parent
6abfe3ff70
commit
7cf3abbaf0
@ -458,18 +458,15 @@ fn iterative_auth_check<E: Event + Clone>(
|
|||||||
// The key for this is (eventType + a state_key of the signed token not sender) so
|
// The key for this is (eventType + a state_key of the signed token not sender) so
|
||||||
// search for it
|
// search for it
|
||||||
let current_third_party = auth_events.iter().find_map(|(_, pdu)| {
|
let current_third_party = auth_events.iter().find_map(|(_, pdu)| {
|
||||||
(*pdu.event_type() == EventType::RoomThirdPartyInvite).then(|| {
|
(*pdu.event_type() == EventType::RoomThirdPartyInvite).then(|| pdu)
|
||||||
// TODO no clone, auth_events is borrowed while moved
|
|
||||||
pdu.clone()
|
|
||||||
})
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if auth_check(
|
if auth_check(
|
||||||
room_version,
|
room_version,
|
||||||
&event,
|
&event,
|
||||||
most_recent_prev_event.as_ref(),
|
most_recent_prev_event.as_ref(),
|
||||||
current_third_party.as_ref(),
|
current_third_party,
|
||||||
|ty, key| auth_events.get(&(ty.clone(), key.to_owned())).cloned(),
|
|ty, key| auth_events.get(&(ty.clone(), key.to_owned())),
|
||||||
)? {
|
)? {
|
||||||
// add event to resolved state map
|
// add event to resolved state map
|
||||||
resolved_state
|
resolved_state
|
||||||
|
Loading…
x
Reference in New Issue
Block a user