Re: [PATCH 1/8] qemu: bulk stats: extend internal collection API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2014/9/8 21:05, Francesco Romani wrote:
> +static bool
> +qemuDomainGetStatsNeedMonitor(unsigned int stats)
> +{
> +    size_t i;
> +
> +    for (i = 0; qemuDomainGetStatsWorkers[i].func; i++)
> +        if (stats & qemuDomainGetStatsWorkers[i].stats)
> +            if (qemuDomainGetStatsWorkers[i].monitor)
> +                return true;
> +
> +    return false;
> +}

'stats' is not necessary in the loop.

How about this style?

static bool
qemuDomainGetStatsNeedMonitor(unsigned int stats)
{
    size_t i;

    if (!stats)
        return false;

    for (i = 0; qemuDomainGetStatsWorkers[i].func; i++)
        if (qemuDomainGetStatsWorkers[i].stats &&
            qemuDomainGetStatsWorkers[i].monitor)
            return true;

    return false;
}


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]