[libvirt] [PATCH 6/7] util: Remove need for local 'nelems'

Peter Krempa pkrempa at redhat.com
Mon Oct 10 16:03:32 UTC 2016


On Mon, Oct 10, 2016 at 11:42:17 -0400, John Ferlan wrote:
> Since it's only used in loop - just go direct.

Not sure how deep coverity sees stuff, but in some cases this would
increase the complexity of the loop from O(n) to O(n^2) since the
function gets evaluated on every single loop, but the returned value
never changes.

In this case it's okay, since virJSONValueArraySize does not do any
iteration over the list.

> 
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---

ACK in this case, but we need to be careful.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20161010/bb77e41e/attachment-0001.sig>


More information about the libvir-list mailing list