提交 b2b8fc91 编写于 作者: J Ján Tomko

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.
上级 ca70db39
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册