mirror of
https://github.com/espressif/openthread.git
synced 2026-08-22 02:19:52 +00:00
[style] convert to C++11 for loops (#5263)
This commit is contained in:
+5
-5
@@ -60,9 +60,9 @@ otError UdpExample::ProcessHelp(uint8_t aArgsLength, char *aArgs[])
|
||||
OT_UNUSED_VARIABLE(aArgsLength);
|
||||
OT_UNUSED_VARIABLE(aArgs);
|
||||
|
||||
for (size_t i = 0; i < OT_ARRAY_LENGTH(sCommands); i++)
|
||||
for (const Command &command : sCommands)
|
||||
{
|
||||
mInterpreter.mServer->OutputFormat("%s\r\n", sCommands[i].mName);
|
||||
mInterpreter.mServer->OutputFormat("%s\r\n", command.mName);
|
||||
}
|
||||
|
||||
return OT_ERROR_NONE;
|
||||
@@ -269,11 +269,11 @@ otError UdpExample::Process(uint8_t aArgsLength, char *aArgs[])
|
||||
}
|
||||
else
|
||||
{
|
||||
for (size_t i = 0; i < OT_ARRAY_LENGTH(sCommands); i++)
|
||||
for (const Command &command : sCommands)
|
||||
{
|
||||
if (strcmp(aArgs[0], sCommands[i].mName) == 0)
|
||||
if (strcmp(aArgs[0], command.mName) == 0)
|
||||
{
|
||||
error = (this->*sCommands[i].mCommand)(aArgsLength - 1, aArgs + 1);
|
||||
error = (this->*command.mCommand)(aArgsLength - 1, aArgs + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user