Skip to content

Commit ed9a300

Browse files
committed
refactor(wifi): reuse strstr result instead of recomputing it
1 parent dd36722 commit ed9a300

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/system/wifi/esp32SpiAt.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ bool WiFiClass::sendAtCommandWithResponse(char *_atCommand, unsigned long _timeo
424424
char *_responseMatch = strstr(_dataBuffer, _expectedResponseAtCmd);
425425

426426
// If substring function returns NULL, match is not found.
427-
if (strstr(_dataBuffer, _expectedResponseAtCmd) == NULL)
427+
if (_responseMatch == NULL)
428428
{
429429
// If flag for termination on unexpected response is set, return from the function.
430430
if (_terminateOnAtResponseError)

0 commit comments

Comments
 (0)