]> xenbits.xensource.com Git - libvirt.git/commitdiff
virConfSetValue: Simplify condition
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 9 Dec 2014 13:48:54 +0000 (14:48 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 15 Dec 2014 09:34:18 +0000 (10:34 +0100)
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@redhat.com>
src/util/virconf.c

index 0a17eff3865dd607fd18ba80083d531c19670070..74e695a894522d756c8b36adb3c3382c3e3c1828 100644 (file)
@@ -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;