style: reduce variable scope in EpubReaderActivity
Some checks failed
CI / build (push) Failing after 2m31s
Some checks failed
CI / build (push) Failing after 2m31s
Move cachedRenderer, cachedMappedInput, and cachedSection declarations into the DICTIONARY action block where they're actually used, addressing cppcheck variableScope warnings.
This commit is contained in:
parent
3e3be8bd23
commit
f3075002c1
@ -386,15 +386,15 @@ void EpubReaderActivity::loop() {
|
||||
[this](QuickMenuAction action) {
|
||||
// Cache values before exitActivity
|
||||
EpubReaderActivity* self = this;
|
||||
GfxRenderer& cachedRenderer = renderer;
|
||||
MappedInputManager& cachedMappedInput = mappedInput;
|
||||
const Section* cachedSection = section.get();
|
||||
SemaphoreHandle_t cachedMutex = renderingMutex;
|
||||
|
||||
exitActivity();
|
||||
|
||||
if (action == QuickMenuAction::DICTIONARY) {
|
||||
// Open dictionary menu
|
||||
// Open dictionary menu - cache renderer/input for this scope
|
||||
GfxRenderer& cachedRenderer = self->renderer;
|
||||
MappedInputManager& cachedMappedInput = self->mappedInput;
|
||||
const Section* cachedSection = self->section.get();
|
||||
self->enterNewActivity(new DictionaryMenuActivity(
|
||||
cachedRenderer, cachedMappedInput,
|
||||
[self](DictionaryMode mode) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user