Skip to content

Commit

Permalink
hir: Avoid copy in getter (PathPattern)
Browse files Browse the repository at this point in the history
gcc/rust/ChangeLog:

	* hir/tree/rust-hir-path.h: Avoid copy in getter.

Signed-off-by: Jakub Dupak <[email protected]>
  • Loading branch information
jdupak authored and CohenArthur committed Oct 23, 2023
1 parent 2e3e600 commit af3071f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gcc/rust/hir/tree/rust-hir-path.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ class PathPattern : public Pattern

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
{
Expand Down

0 comments on commit af3071f

Please sign in to comment.