render / rpms / libvirt

Forked from rpms/libvirt 11 months ago
Clone
127bba
From 5357b85bd1454127075feb039ae1b3c9216fc77e Mon Sep 17 00:00:00 2001
127bba
Message-Id: <5357b85bd1454127075feb039ae1b3c9216fc77e@dist-git>
127bba
From: Martin Kletzander <mkletzan@redhat.com>
127bba
Date: Fri, 4 Nov 2016 10:29:47 +0100
127bba
Subject: [PATCH] conf: Don't complicate find loop
127bba
127bba
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
127bba
(cherry picked from commit d7107959c3cd9f113158b9165449f9c7d4754113)
127bba
127bba
https://bugzilla.redhat.com/show_bug.cgi?id=1392031
127bba
127bba
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
127bba
---
127bba
 src/conf/domain_conf.c | 5 +----
127bba
 1 file changed, 1 insertion(+), 4 deletions(-)
127bba
127bba
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
127bba
index 8afd2b0..25e4ba2 100644
127bba
--- a/src/conf/domain_conf.c
127bba
+++ b/src/conf/domain_conf.c
127bba
@@ -14884,12 +14884,9 @@ virDomainShmemDefFind(virDomainDefPtr def,
127bba
 
127bba
     for (i = 0; i < def->nshmems; i++) {
127bba
         if (virDomainShmemDefEquals(shmem, def->shmems[i]))
127bba
-            break;
127bba
+            return i;
127bba
     }
127bba
 
127bba
-    if (i < def->nshmems)
127bba
-        return i;
127bba
-
127bba
     return -1;
127bba
 }
127bba
 
127bba
-- 
127bba
2.10.2
127bba