From ec1488c15e1b46888e5e0ff11b7e2c54447c5546 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 18 Aug 2026 17:51:39 -0700 Subject: [PATCH] avoid an allocation --- rust/pspp/src/spv/read/graph.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rust/pspp/src/spv/read/graph.rs b/rust/pspp/src/spv/read/graph.rs index d3fc583df7..4869e1a599 100644 --- a/rust/pspp/src/spv/read/graph.rs +++ b/rust/pspp/src/spv/read/graph.rs @@ -4444,13 +4444,13 @@ impl<'a> FrameType<'a> { } } - fn locations(&self) -> Vec<&Location> { + fn locations(&self) -> &[Location] { match self { - FrameType::Visualization(visualization) => visualization.locations(), - FrameType::Container(container) => container.locations.iter().collect(), - FrameType::Graph(graph) => graph.locations.iter().collect(), - FrameType::LabelFrame(label_frame) => label_frame.locations(), - FrameType::Legend(legend) => legend.locations(), + FrameType::Visualization(visualization) => &visualization.locations, + FrameType::Container(container) => &container.locations, + FrameType::Graph(graph) => &graph.locations, + FrameType::LabelFrame(label_frame) => &label_frame.locations, + FrameType::Legend(legend) => &legend.locations, } } -- 2.47.3