state-res: Remove pointless .unwrap()

This commit is contained in:
Jonas Platte 2021-08-31 19:02:03 +02:00
parent dc842f028f
commit a3707b1a3a
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67

View File

@ -614,9 +614,7 @@ impl StateResolution {
F: Fn(&EventId) -> Option<Arc<E>>, F: Fn(&EventId) -> Option<Arc<E>>,
{ {
let mut state = vec![event_id.clone()]; let mut state = vec![event_id.clone()];
while !state.is_empty() { while let Some(eid) = state.pop() {
// We just checked if it was empty so unwrap is fine
let eid = state.pop().unwrap();
graph.entry(eid.clone()).or_insert(hashset![]); graph.entry(eid.clone()).or_insert(hashset![]);
// Prefer the store to event as the store filters dedups the events // Prefer the store to event as the store filters dedups the events
for aid in &fetch_event(&eid).map(|ev| ev.auth_events()).unwrap_or_default() { for aid in &fetch_event(&eid).map(|ev| ev.auth_events()).unwrap_or_default() {