提交 6aba5346 编写于 作者: J John Ferlan

util: Remove need for local 'nelems'

Since it's only used in loop - just go direct.
上级 e5c7ce8c
......@@ -85,12 +85,11 @@ virQEMUBuildCommandLineJSONArrayNumbered(const char *key,
virBufferPtr buf)
{
const virJSONValue *member;
ssize_t nelems = virJSONValueArraySize(array);
char *prefix = NULL;
size_t i;
int ret = 0;
for (i = 0; i < nelems; i++) {
for (i = 0; i < virJSONValueArraySize(array); i++) {
member = virJSONValueArrayGet((virJSONValuePtr) array, i);
if (virAsprintf(&prefix, "%s.%zu", key, i) < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册