]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuInteropFetchConfigs: Don't use 'virStringListAdd' to construct list
authorPeter Krempa <pkrempa@redhat.com>
Fri, 5 Feb 2021 14:09:12 +0000 (15:09 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 11 Feb 2021 16:05:32 +0000 (17:05 +0100)
commitf060d62c757c95a597a64610e26112f333ec80c4
tree4273720f9f90c2f53cf342dc404940def66bc168
parent97fd333fdef86621683854db94028ed535721784
qemuInteropFetchConfigs: Don't use 'virStringListAdd' to construct list

'virHashGetItems' already returns the number of entries which will be
considered for addition to the list so we can allocate it to the upper
bound upfront rather than growing it in a loop. This avoids the
quadratic complexity of 'virStringListAdd'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_interop_config.c