|
|
@ -58,6 +58,8 @@ void grpc_json_destroy(grpc_json* json) { |
|
|
|
|
|
|
|
|
|
|
|
grpc_json* grpc_json_link_child(grpc_json* parent, grpc_json* child, |
|
|
|
grpc_json* grpc_json_link_child(grpc_json* parent, grpc_json* child, |
|
|
|
grpc_json* sibling) { |
|
|
|
grpc_json* sibling) { |
|
|
|
|
|
|
|
// link child up to parent
|
|
|
|
|
|
|
|
child->parent = parent; |
|
|
|
// first child case.
|
|
|
|
// first child case.
|
|
|
|
if (parent->child == nullptr) { |
|
|
|
if (parent->child == nullptr) { |
|
|
|
GPR_ASSERT(sibling == nullptr); |
|
|
|
GPR_ASSERT(sibling == nullptr); |
|
|
@ -81,7 +83,6 @@ grpc_json* grpc_json_create_child(grpc_json* sibling, grpc_json* parent, |
|
|
|
grpc_json* child = grpc_json_create(type); |
|
|
|
grpc_json* child = grpc_json_create(type); |
|
|
|
grpc_json_link_child(parent, child, sibling); |
|
|
|
grpc_json_link_child(parent, child, sibling); |
|
|
|
child->owns_value = owns_value; |
|
|
|
child->owns_value = owns_value; |
|
|
|
child->parent = parent; |
|
|
|
|
|
|
|
child->value = value; |
|
|
|
child->value = value; |
|
|
|
child->key = key; |
|
|
|
child->key = key; |
|
|
|
return child; |
|
|
|
return child; |
|
|
|