From 497704f3b9abb816a8815539587fe2cd8675bcc5 Mon Sep 17 00:00:00 2001 From: Ramon Roche Date: Mon, 9 Feb 2026 15:10:43 -0800 Subject: [PATCH] fw_mode_manager: pass FigureEightPatternPoints by const reference The 48-byte struct (6 Vector2f) is only read inside initializePattern, so passing by value creates an unnecessary copy. Fixes performance-unnecessary-value-param clang-tidy diagnostic. Signed-off-by: Ramon Roche --- src/modules/fw_mode_manager/figure_eight/FigureEight.cpp | 2 +- src/modules/fw_mode_manager/figure_eight/FigureEight.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/fw_mode_manager/figure_eight/FigureEight.cpp b/src/modules/fw_mode_manager/figure_eight/FigureEight.cpp index f7585f39b4..a995d28543 100644 --- a/src/modules/fw_mode_manager/figure_eight/FigureEight.cpp +++ b/src/modules/fw_mode_manager/figure_eight/FigureEight.cpp @@ -105,7 +105,7 @@ FigureEight::FigureEightPatternParameters FigureEight::sanitizeParameters(const } void FigureEight::initializePattern(const matrix::Vector2f &curr_pos_local, const matrix::Vector2f &ground_speed, - const FigureEightPatternParameters ¶meters, FigureEightPatternPoints pattern_points) + const FigureEightPatternParameters ¶meters, const FigureEightPatternPoints &pattern_points) { // Initialize the currently active segment, if it hasn't been active yet, or the pattern has been changed. if ((_current_segment == FigureEightSegment::SEGMENT_UNDEFINED) || (_active_parameters != parameters)) { diff --git a/src/modules/fw_mode_manager/figure_eight/FigureEight.hpp b/src/modules/fw_mode_manager/figure_eight/FigureEight.hpp index 297e07942c..fcdb39915c 100644 --- a/src/modules/fw_mode_manager/figure_eight/FigureEight.hpp +++ b/src/modules/fw_mode_manager/figure_eight/FigureEight.hpp @@ -140,7 +140,7 @@ private: * @param[in] pattern_points are the figure of eight pattern points. */ void initializePattern(const matrix::Vector2f &curr_pos_local, const matrix::Vector2f &ground_speed, - const FigureEightPatternParameters ¶meters, FigureEightPatternPoints pattern_points); + const FigureEightPatternParameters ¶meters, const FigureEightPatternPoints &pattern_points); /** * @brief Calculate figure eight pattern points