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

Michal Privoznik mprivozn at redhat.com
Tue Dec 9 15:52:14 UTC 2014


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 at redhat.com>
---
 src/util/virconf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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




More information about the libvir-list mailing list