Use break inside loop with false condition

Found by clang-tidy.

    home/christian/Coding/workspaces/htop/Process.c:505:13: warning: 'continue' in loop with false condition is equivalent to 'break' [bugprone-terminating-continue]
               WRITE_HIGHLIGHT(0, strlen(procComm), commAttr, CMDLINE_HIGHLIGHT_FLAG_COMM);
               ^
    /home/christian/Coding/workspaces/htop/Process.c:461:13: note: expanded from macro 'WRITE_HIGHLIGHT'
                continue;                                                                         \
                ^
This commit is contained in:
Christian Göttsche 2021-08-22 17:14:36 +02:00 committed by BenBE
parent c3746dc901
commit 5dec9475bb
1 changed files with 1 additions and 1 deletions

View File

@ -458,7 +458,7 @@ void Process_makeCommandStr(Process* this) {
/* Check if we still have capacity */ \
assert(mc->highlightCount < ARRAYSIZE(mc->highlights)); \
if (mc->highlightCount >= ARRAYSIZE(mc->highlights)) \
continue; \
break; \
\
mc->highlights[mc->highlightCount].offset = str - strStart + (_offset) - mbMismatch; \
mc->highlights[mc->highlightCount].length = _length; \