提交 9f00ff9a 编写于 作者: J Jonathan Fether 提交者: GitHub

Remove redundant test from cJSON_AddItemToArray

The test for whether "c" is null is redundant.  Since this is the else case of "(!c)", and the only way "c" is changed is by the instruction assigning it "c->next" on the condition here, simply verifying that "c->next" isn't null is sufficient.
上级 1822521a
......@@ -1658,7 +1658,7 @@ void cJSON_AddItemToArray(cJSON *array, cJSON *item)
else
{
/* append to the end */
while (c && c->next)
while (c->next)
{
c = c->next;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册