Re: [PATCH v1 1/3] virConfSetValue: Simplify condition

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

 



On Tue, Dec 09, 2014 at 04:52:14PM +0100, Michal Privoznik wrote:
There's no need for condition of the following form:

 if (str && STREQ(str, dst))

since we have STREQ_NULLABLE macro that handles NULL cases.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
src/util/virconf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


ACK

diff --git a/src/util/virconf.c b/src/util/virconf.c
index 0a17eff..74e695a 100644
--- a/src/util/virconf.c
+++ b/src/util/virconf.c
@@ -884,7 +884,7 @@ virConfSetValue(virConfPtr conf,

    cur = conf->entries;
    while (cur != NULL) {
-        if ((cur->name != NULL) && (STREQ(cur->name, setting)))
+        if (STREQ_NULLABLE(cur->name, setting))
            break;
        prev = cur;
        cur = cur->next;
--
2.0.4

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

Attachment: signature.asc
Description: Digital signature

--
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]