mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 09:53:10 +00:00
cpu_x86: Simplify x86DataAdd
The while loop just copied half of virCPUx86DataAddItem. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
3eff71a2d5
commit
0fdc0ad84c
@ -405,18 +405,11 @@ x86DataAdd(virCPUx86Data *data1,
|
||||
const virCPUx86Data *data2)
|
||||
{
|
||||
virCPUx86DataIterator iter = virCPUx86DataIteratorInit(data2);
|
||||
virCPUx86DataItemPtr item1;
|
||||
virCPUx86DataItemPtr item2;
|
||||
virCPUx86DataItemPtr item;
|
||||
|
||||
while ((item2 = virCPUx86DataNext(&iter))) {
|
||||
item1 = virCPUx86DataGet(data1, item2);
|
||||
|
||||
if (item1) {
|
||||
x86cpuidSetBits(&item1->cpuid, &item2->cpuid);
|
||||
} else {
|
||||
if (virCPUx86DataAddItem(data1, item2) < 0)
|
||||
return -1;
|
||||
}
|
||||
while ((item = virCPUx86DataNext(&iter))) {
|
||||
if (virCPUx86DataAddItem(data1, item) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user