aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2023-08-23 13:50:16 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-30 12:36:43 +0100
commit66e8a1614e4cc9d3eb92f1288cf19a805b21ac1a (patch)
treebe84b99f42cd2b676119a5898dd567b2f4efe6c5
parent5fd3de11508e7205e39b5fe00d8b4fd4789aeb86 (diff)
downloadgcc-66e8a1614e4cc9d3eb92f1288cf19a805b21ac1a.zip
gcc-66e8a1614e4cc9d3eb92f1288cf19a805b21ac1a.tar.gz
gcc-66e8a1614e4cc9d3eb92f1288cf19a805b21ac1a.tar.bz2
gccrs: forever stack: Improve resolve_path implementation
gcc/rust/ChangeLog: * resolve/rust-forever-stack.hxx: Do not copy segment when dereferencing iterator in `find_starting_point`.
-rw-r--r--gcc/rust/resolve/rust-forever-stack.hxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/rust/resolve/rust-forever-stack.hxx b/gcc/rust/resolve/rust-forever-stack.hxx
index 8f0ab66..642135c 100644
--- a/gcc/rust/resolve/rust-forever-stack.hxx
+++ b/gcc/rust/resolve/rust-forever-stack.hxx
@@ -333,7 +333,7 @@ ForeverStack<N>::find_starting_point (const std::vector<S> &segments,
for (; !is_last (iterator, segments); iterator++)
{
- auto seg = *iterator;
+ auto &seg = *iterator;
auto is_self_or_crate
= seg.is_crate_path_seg () || seg.is_lower_self_seg ();