Skip to content

Commit

Permalink
Reduce allocations
Browse files Browse the repository at this point in the history
  • Loading branch information
0HyperCube committed Dec 16, 2024
1 parent a63fe80 commit d322704
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1595,10 +1595,10 @@ impl NodeNetworkInterface {
network_metadata.persistent_metadata.selection_undo_history.back().cloned().unwrap_or_default()
};

let layers_except_artboards: Vec<_> = last_selection_state.selected_layers_except_artboards(self).collect();
let is_selection_empty = last_selection_state.selected_layers_except_artboards(self).next().is_none();

// If the selection is empty or contains only artboards, skip the undo history update.
if layers_except_artboards.is_empty() {
if is_selection_empty {
let Some(network_metadata) = self.network_metadata_mut(network_path) else {
log::error!("Could not get nested network_metadata in selected_nodes");
return None;
Expand Down

0 comments on commit d322704

Please sign in to comment.