[Libguestfs] [PATCH 2/2] inspect: Don't re-implement list_filesystems in inspect_os

Richard W.M. Jones rjones at redhat.com
Fri Feb 8 11:36:25 UTC 2013


On Thu, Feb 07, 2013 at 02:31:10PM +0000, Matthew Booth wrote:
> +  for (char **fs = fses; *fs; fs += 2) {
> +    if (guestfs___check_for_filesystem_on (g, *fs)) {

Don't you find this sort of loop confusing?  I much prefer:

  size_t i;
  //...
  for (i = 0; fs[i] != NULL; i += 2)
    //...

and I'm sure the compiler will generate the same code for both cases.

Patch looks good, but I'd prefer the loop as above.  ACK.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top




More information about the Libguestfs mailing list