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.
This commit is contained in:
Jonathan Fether authored and GitHub committed 2016-10-27 20:02:44 -07:00
1 parent 1822521a14
commit 9f00ff9a91
1 file changed
+1 -1
+1 -1
View File
@@ -1658,7 +1658,7 @@ void cJSON_AddItemToArray(cJSON *array, cJSON *item)
else else
{ {
/* append to the end */ /* append to the end */
while (c && c->next) while (c->next)
{ {
c = c->next; c = c->next;
} }