1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

util: json: Remove 'virJSONValueObjectReplaceValue'

The helper was used only in 'qemucapabilitiesnumbering' test which was
removed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
Peter Krempa 2024-01-15 15:42:14 +01:00
parent 19f9cf2ae8
commit b8d9419e12
3 changed files with 0 additions and 27 deletions

View File

@ -2665,7 +2665,6 @@ virJSONValueObjectHasKey;
virJSONValueObjectKeysNumber;
virJSONValueObjectPrependString;
virJSONValueObjectRemoveKey;
virJSONValueObjectReplaceValue;
virJSONValueObjectStealArray;
virJSONValueObjectStealObject;
virJSONValueToBuffer;

View File

@ -1136,26 +1136,6 @@ virJSONValueObjectGetString(virJSONValue *object,
}
void
virJSONValueObjectReplaceValue(virJSONValue *object,
const char *key,
virJSONValue **newval)
{
size_t i;
if (object->type != VIR_JSON_TYPE_OBJECT ||
!*newval)
return;
for (i = 0; i < object->data.object.npairs; i++) {
if (STREQ(object->data.object.pairs[i].key, key)) {
virJSONValueFree(object->data.object.pairs[i].value);
object->data.object.pairs[i].value = g_steal_pointer(newval);
}
}
}
/**
* virJSONValueObjectGetStringOrNumber:
* @object: JSON value object

View File

@ -241,12 +241,6 @@ virJSONValueObjectRemoveKey(virJSONValue *object,
virJSONValue **value)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
void
virJSONValueObjectReplaceValue(virJSONValue *object,
const char *key,
virJSONValue **newval)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
int
virJSONValueArrayAppendString(virJSONValue *object,
const char *value);