1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-11 09:17:52 +03:00

conf: use insertAt instead of j

We call VIR_INSERT_ELEMENT_INPLACE either with 0 (for primary video)
or def->nvideos (for the rest).

Use a variable with more semantic name, since j is usually used
for iterating.
This commit is contained in:
Ján Tomko 2016-04-11 14:45:46 +02:00
parent ca70db398e
commit b2b8fc919d

View File

@ -16420,8 +16420,8 @@ virDomainDefParseXML(xmlDocPtr xml,
if (n && VIR_ALLOC_N(def->videos, n) < 0)
goto error;
for (i = 0; i < n; i++) {
j = def->nvideos;
virDomainVideoDefPtr video;
ssize_t insertAt = -1;
if (!(video = virDomainVideoDefParseXML(nodes[i], def, flags)))
goto error;
@ -16434,11 +16434,11 @@ virDomainDefParseXML(xmlDocPtr xml,
goto error;
}
j = 0;
insertAt = 0;
primaryVideo = true;
}
if (VIR_INSERT_ELEMENT_INPLACE(def->videos,
j,
insertAt,
def->nvideos,
video) < 0) {
virDomainVideoDefFree(video);