mirror of
https://github.com/espressif/openthread.git
synced 2026-06-05 21:14:49 +00:00
[style] convert to C++11 for loops (#5263)
This commit is contained in:
@@ -192,11 +192,11 @@ otError Dataset::Process(uint8_t aArgsLength, char *aArgs[])
|
||||
ExitNow(error = Print(sDataset));
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -210,9 +210,9 @@ otError Dataset::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;
|
||||
|
||||
Reference in New Issue
Block a user