Skip to content

Commit

Permalink
filtering empty selections
Browse files Browse the repository at this point in the history
  • Loading branch information
0SlowPoke0 authored and Keavon committed Nov 21, 2024
1 parent d7a271f commit 350503f
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1607,7 +1607,12 @@ impl NodeNetworkInterface {
return;
};

if let Some(selection_state) = network_metadata.persistent_metadata.selection_undo_history.pop_back() {
let mut non_empty_selections:VecDeque<SelectedNodes> = network_metadata.persistent_metadata.selection_redo_history.iter().
filter(|selected_nodes| selected_nodes.has_selected_nodes()).
cloned().
collect();

if let Some(selection_state) = non_empty_selections.pop_back() {
network_metadata.persistent_metadata.selection_redo_history.push_front(selection_state);
}
}
Expand All @@ -1618,7 +1623,12 @@ impl NodeNetworkInterface {
return;
};

if let Some(selection_state) = network_metadata.persistent_metadata.selection_redo_history.pop_front() {
let mut non_empty_selections:VecDeque<SelectedNodes> = network_metadata.persistent_metadata.selection_redo_history.iter().
filter(|selected_nodes| selected_nodes.has_selected_nodes()).
cloned().
collect();

if let Some(selection_state) = non_empty_selections.pop_front() {
network_metadata.persistent_metadata.selection_undo_history.push_back(selection_state);
}
}
Expand Down

0 comments on commit 350503f

Please sign in to comment.