MCPcopy Create free account
hub / github.com/OpenDriveLab/OpenLane / cJSON_DetachItemFromArray

Function cJSON_DetachItemFromArray

eval/LANE_evaluation/lane2d/src/cJSON.c:906–921  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

904}
905
906cJSON *cJSON_DetachItemFromArray(cJSON *array, int which)
907{
908 cJSON *c = array->child;
909 while (c && which > 0)
910 c = c->next, which--;
911 if (!c)
912 return 0;
913 if (c->prev)
914 c->prev->next = c->next;
915 if (c->next)
916 c->next->prev = c->prev;
917 if (c == array->child)
918 array->child = c->next;
919 c->prev = c->next = 0;
920 return c;
921}
922void cJSON_DeleteItemFromArray(cJSON *array, int which)
923{
924 cJSON_Delete(cJSON_DetachItemFromArray(array, which));

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected