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) {
|
[this](QuickMenuAction action) {
|
||||||
// Cache values before exitActivity
|
// Cache values before exitActivity
|
||||||
EpubReaderActivity* self = this;
|
EpubReaderActivity* self = this;
|
||||||
GfxRenderer& cachedRenderer = renderer;
|
|
||||||
MappedInputManager& cachedMappedInput = mappedInput;
|
|
||||||
const Section* cachedSection = section.get();
|
|
||||||
SemaphoreHandle_t cachedMutex = renderingMutex;
|
SemaphoreHandle_t cachedMutex = renderingMutex;
|
||||||
|
|
||||||
exitActivity();
|
exitActivity();
|
||||||
|
|
||||||
if (action == QuickMenuAction::DICTIONARY) {
|
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(
|
self->enterNewActivity(new DictionaryMenuActivity(
|
||||||
cachedRenderer, cachedMappedInput,
|
cachedRenderer, cachedMappedInput,
|
||||||
[self](DictionaryMode mode) {
|
[self](DictionaryMode mode) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user