提交 0fdc0ad8 编写于 作者: J Jiri Denemark

cpu_x86: Simplify x86DataAdd

The while loop just copied half of virCPUx86DataAddItem.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 3eff71a2
......@@ -405,19 +405,12 @@ x86DataAdd(virCPUx86Data *data1,
const virCPUx86Data *data2)
{
virCPUx86DataIterator iter = virCPUx86DataIteratorInit(data2);
virCPUx86DataItemPtr item1;
virCPUx86DataItemPtr item2;
while ((item2 = virCPUx86DataNext(&iter))) {
item1 = virCPUx86DataGet(data1, item2);
virCPUx86DataItemPtr item;
if (item1) {
x86cpuidSetBits(&item1->cpuid, &item2->cpuid);
} else {
if (virCPUx86DataAddItem(data1, item2) < 0)
while ((item = virCPUx86DataNext(&iter))) {
if (virCPUx86DataAddItem(data1, item) < 0)
return -1;
}
}
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册