aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Dupak <dev@jakubdupak.com>2023-10-17 17:23:16 +0200
committerCohenArthur <arthur.cohen@embecosm.com>2023-10-23 11:37:37 +0000
commitaf3071fc346d0e6cfd7c36a5b203589d5e1b2f85 (patch)
treecce568fa5f99bf6a33c8193acbcc73e75fd79650
parent2e3e60036006200ab00e556a7e501a6d6a8d766a (diff)
downloadgcc-af3071fc346d0e6cfd7c36a5b203589d5e1b2f85.zip
gcc-af3071fc346d0e6cfd7c36a5b203589d5e1b2f85.tar.gz
gcc-af3071fc346d0e6cfd7c36a5b203589d5e1b2f85.tar.bz2
hir: Avoid copy in getter (PathPattern)
gcc/rust/ChangeLog: * hir/tree/rust-hir-path.h: Avoid copy in getter. Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
-rw-r--r--gcc/rust/hir/tree/rust-hir-path.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/rust/hir/tree/rust-hir-path.h b/gcc/rust/hir/tree/rust-hir-path.h
index f390b43..c074480 100644
--- a/gcc/rust/hir/tree/rust-hir-path.h
+++ b/gcc/rust/hir/tree/rust-hir-path.h
@@ -321,7 +321,7 @@ public:
PathExprSegment &get_root_seg () { return segments.at (0); }
- PathExprSegment get_final_segment () const { return segments.back (); }
+ const PathExprSegment &get_final_segment () const { return segments.back (); }
PatternType get_pattern_type () const override final
{