cppcheck complaint

This commit is contained in:
jpirnay
2026-04-26 23:11:18 +02:00
parent c32757e4a1
commit 7e9c953127
+7 -6
View File
@@ -12,6 +12,8 @@
#include <HalStorage.h> #include <HalStorage.h>
#include <I18n.h> #include <I18n.h>
#include <algorithm>
#include "CrossPointSettings.h" #include "CrossPointSettings.h"
#include "CrossPointState.h" #include "CrossPointState.h"
#include "MappedInputManager.h" #include "MappedInputManager.h"
@@ -462,12 +464,11 @@ void XtcReaderActivity::onButtonAction(const CrossPointSettings::BUTTON_ACTION a
case BA::BTN_NEXT_SECTION: case BA::BTN_NEXT_SECTION:
if (xtc->hasChapters()) { if (xtc->hasChapters()) {
const auto& chapters = xtc->getChapters(); const auto& chapters = xtc->getChapters();
for (const auto& ch : chapters) { const auto it = std::find_if(chapters.begin(), chapters.end(),
if (ch.startPage > currentPage) { [this](const auto& ch) { return ch.startPage > currentPage; });
currentPage = ch.startPage; if (it != chapters.end()) {
requestUpdate(); currentPage = it->startPage;
break; requestUpdate();
}
} }
} }
break; break;