state-res: Remove pointless shifting around of Vec elements
This commit is contained in:
parent
9c5b2e3d8c
commit
815fd19a33
@ -192,7 +192,10 @@ impl StateResolution {
|
|||||||
state_sets.iter().map(|state_set| state_set.get(key)).collect::<Vec<_>>();
|
state_sets.iter().map(|state_set| state_set.get(key)).collect::<Vec<_>>();
|
||||||
|
|
||||||
if event_ids.iter().all_equal() {
|
if event_ids.iter().all_equal() {
|
||||||
let id = event_ids.remove(0).expect("unconflicting `EventId` is not None");
|
// First .unwrap() is okay because
|
||||||
|
// * event_ids has the same length as state_sets
|
||||||
|
// * we never enter the loop this code is in if state_sets is empty
|
||||||
|
let id = event_ids.pop().unwrap().expect("unconflicting `EventId` is not None");
|
||||||
unconflicted_state.insert(key.clone(), id.clone());
|
unconflicted_state.insert(key.clone(), id.clone());
|
||||||
} else {
|
} else {
|
||||||
conflicted_state
|
conflicted_state
|
||||||
|
Loading…
x
Reference in New Issue
Block a user