]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virDomainDiskByName: Remove ternary operator
authorPeter Krempa <pkrempa@redhat.com>
Tue, 1 Dec 2020 16:54:41 +0000 (17:54 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 3 Dec 2020 11:25:01 +0000 (12:25 +0100)
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/domain_conf.c

index 5ac4f011f90dbeaf74c5fde235d9b5ad76b466ac..425e3c3710d31bfe44b46e5ad6fe5b3dcc25d361 100644 (file)
@@ -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];
 }