From 9966da65627ffd01f2712d2dc289bd077017c774 Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Fri, 20 Dec 2024 14:39:04 -0600 Subject: [PATCH] fix sa --- .../hid_service/include/hid_service.hpp | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/components/hid_service/include/hid_service.hpp b/components/hid_service/include/hid_service.hpp index ba41d437a..6a22e5b43 100644 --- a/components/hid_service/include/hid_service.hpp +++ b/components/hid_service/include/hid_service.hpp @@ -153,9 +153,10 @@ class HidService : public espp::BaseComponent { std::lock_guard lock(input_report_characteristics_mutex_); // look up the report ID in the list of input report characteristics - for (auto &input_report : input_report_characteristics_) { - if (input_report.first == report_id) { - return input_report.second; + for (const auto &report_char : input_report_characteristics_) { + // cppcheck-suppress useStlAlgorithm + if (report_char.first == report_id) { + return report_char.second; } } @@ -185,9 +186,10 @@ class HidService : public espp::BaseComponent { std::lock_guard lock(output_report_characteristics_mutex_); // look up the report ID in the list of output report characteristics - for (auto &output_report : output_report_characteristics_) { - if (output_report.first == report_id) { - return output_report.second; + for (const auto &report_char : output_report_characteristics_) { + // cppcheck-suppress useStlAlgorithm + if (report_char.first == report_id) { + return report_char.second; } } @@ -220,9 +222,10 @@ class HidService : public espp::BaseComponent { std::lock_guard lock(feature_report_characteristics_mutex_); // look up the report ID in the list of feature report characteristics - for (auto &feature_report : feature_report_characteristics_) { - if (feature_report.first == report_id) { - return feature_report.second; + for (const auto &report_char : feature_report_characteristics_) { + // cppcheck-suppress useStlAlgorithm + if (report_char.first == report_id) { + return report_char.second; } }