[PATCH 09/11] virDomainDiskByName: Remove ternary operator

Peter Krempa pkrempa at redhat.com
Wed Dec 2 12:14:59 UTC 2020


Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 src/conf/domain_conf.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 49b68c2c68..6922ebf407 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -17649,7 +17649,11 @@ virDomainDiskByName(virDomainDefPtr def,
                     bool allow_ambiguous)
 {
     int idx = virDomainDiskIndexByName(def, name, allow_ambiguous);
-    return idx < 0 ? NULL : def->disks[idx];
+
+    if (idx < 0)
+        return NULL;
+
+    return def->disks[idx];
 }


-- 
2.28.0




More information about the libvir-list mailing list