Codechange: replace for loops with endof with range-based for loops

This commit is contained in:
Rubidium
2024-04-07 22:18:39 +02:00
committed by rubidium42
parent 095bdf32fe
commit 4e6d4fcf32
6 changed files with 26 additions and 29 deletions

View File

@@ -420,8 +420,8 @@ void EmitGender(Buffer *buffer, char *buf, int)
static const CmdStruct *FindCmd(const char *s, int len)
{
for (const CmdStruct *cs = _cmd_structs; cs != endof(_cmd_structs); cs++) {
if (strncmp(cs->cmd, s, len) == 0 && cs->cmd[len] == '\0') return cs;
for (const auto &cs : _cmd_structs) {
if (strncmp(cs.cmd, s, len) == 0 && cs.cmd[len] == '\0') return &cs;
}
return nullptr;
}