mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-10-04 08:42:38 +00:00
api: machine versions: avoid pushing to array if new one is created anyway
Avoid pushing our array of downstream revisions to the array of upstream machines if we create completely new array on return anyway, just let sort iterate over both arrays instead. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
cc5dc71a7a
commit
e0095011a7
@ -79,9 +79,7 @@ __PACKAGE__->register_method({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
push $machines->@*, $to_add->@*;
|
return [ sort { $b->{id} cmp $a->{id} } ($machines->@*, $to_add->@*) ]; # merge & sort
|
||||||
|
|
||||||
return [sort { $b->{id} cmp $a->{id} } $machines->@*];
|
|
||||||
};
|
};
|
||||||
die "could not load supported machine versions - $@\n" if $@;
|
die "could not load supported machine versions - $@\n" if $@;
|
||||||
return $supported_machine_list;
|
return $supported_machine_list;
|
||||||
|
Loading…
Reference in New Issue
Block a user