Skip to content

Commit

Permalink
fix sa
Browse files Browse the repository at this point in the history
  • Loading branch information
finger563 committed Dec 20, 2024
1 parent a6358a6 commit 9966da6
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions components/hid_service/include/hid_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,10 @@ class HidService : public espp::BaseComponent {
std::lock_guard<std::mutex> 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;
}
}

Expand Down Expand Up @@ -185,9 +186,10 @@ class HidService : public espp::BaseComponent {
std::lock_guard<std::mutex> 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;
}
}

Expand Down Expand Up @@ -220,9 +222,10 @@ class HidService : public espp::BaseComponent {
std::lock_guard<std::mutex> 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;
}
}

Expand Down

0 comments on commit 9966da6

Please sign in to comment.