mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-27 06:55:18 +00:00
util: Remove need for local 'nelems'
Since it's only used in loop - just go direct.
This commit is contained in:
parent
e5c7ce8cd0
commit
6aba53468a
@ -85,12 +85,11 @@ virQEMUBuildCommandLineJSONArrayNumbered(const char *key,
|
|||||||
virBufferPtr buf)
|
virBufferPtr buf)
|
||||||
{
|
{
|
||||||
const virJSONValue *member;
|
const virJSONValue *member;
|
||||||
ssize_t nelems = virJSONValueArraySize(array);
|
|
||||||
char *prefix = NULL;
|
char *prefix = NULL;
|
||||||
size_t i;
|
size_t i;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
for (i = 0; i < nelems; i++) {
|
for (i = 0; i < virJSONValueArraySize(array); i++) {
|
||||||
member = virJSONValueArrayGet((virJSONValuePtr) array, i);
|
member = virJSONValueArrayGet((virJSONValuePtr) array, i);
|
||||||
|
|
||||||
if (virAsprintf(&prefix, "%s.%zu", key, i) < 0)
|
if (virAsprintf(&prefix, "%s.%zu", key, i) < 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user