refactor: sonarcloud "use if init" statements (#2587)

This commit is contained in:
Charles Kerr
2022-02-07 23:44:31 -06:00
committed by GitHub
parent 8afbfecadb
commit ba14ffa74c
26 changed files with 126 additions and 163 deletions

View File

@@ -450,8 +450,7 @@ static void jsonChildFunc(struct jsonWalk* data)
case TR_VARIANT_TYPE_LIST:
{
++pstate.childIndex;
bool const is_last = pstate.childIndex == pstate.childCount;
if (!is_last)
if (bool const is_last = pstate.childIndex == pstate.childCount; !is_last)
{
evbuffer_add(data->out, ",", 1);
jsonIndent(data);