Skip to content

Commit 8d880b1

Browse files
committed
Accessing after move is useless.
1 parent 14637d2 commit 8d880b1

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

cores/esp8266/core_esp8266_wiring_digital.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ namespace
121121

122122
void ICACHE_RAM_ATTR set_interrupt_handlers(uint8_t pin, voidFuncPtr userFunc, uint8_t mode)
123123
{
124-
interrupt_handler_t* handler = &interrupt_handlers[pin];
125-
handler->fn = userFunc;
126-
handler->functional = nullptr;
127-
if (userFunc)
128-
handler->mode = mode;
124+
interrupt_handler_t& handler = interrupt_handlers[pin];
125+
handler.fn = userFunc;
126+
handler.functional = nullptr;
127+
if (handler.fn)
128+
handler.mode = mode;
129129
}
130130

131131
void ICACHE_RAM_ATTR interrupt_handler(void *arg, void *frame)
@@ -251,11 +251,11 @@ namespace
251251
{
252252
void set_interrupt_handlers(uint8_t pin, std::function<void()>&& userFunc, uint8_t mode)
253253
{
254-
interrupt_handler_t* handler = &interrupt_handlers[pin];
255-
handler->fn = nullptr;
256-
handler->functional = std::move(userFunc);
257-
if (userFunc)
258-
handler->mode = mode;
254+
interrupt_handler_t& handler = interrupt_handlers[pin];
255+
handler.fn = nullptr;
256+
handler.functional = std::move(userFunc);
257+
if (handler.functional)
258+
handler.mode = mode;
259259
}
260260
}
261261

0 commit comments

Comments
 (0)