]> xenbits.xensource.com Git - libvirt.git/commitdiff
leaseshelper: remove useless comparison
authorJán Tomko <jtomko@redhat.com>
Thu, 14 Jan 2016 15:49:56 +0000 (16:49 +0100)
committerJán Tomko <jtomko@redhat.com>
Wed, 20 Jan 2016 08:35:50 +0000 (09:35 +0100)
We do not care if the mac was specified in the delete section,
we are going to delete the record anyway.

src/network/leaseshelper.c

index 1e5e3e80c8146748e47d70aac29d9f1bb765b2d3..eb1c0c78e528bdb5c92517388df0fe32eb6b48de 100644 (file)
@@ -416,7 +416,6 @@ main(int argc, char **argv)
          */
         if (!mac)
             break;
-        delete = true;
 
         /* Create new lease */
         if (!(lease_new = virJSONValueNewObject())) {
@@ -448,14 +447,11 @@ main(int argc, char **argv)
         if (expirytime && virJSONValueObjectAppendNumberLong(lease_new, "expiry-time", expirytime) < 0)
             goto cleanup;
 
-        break;
 
+        /* fallthrough */
     case VIR_LEASE_ACTION_DEL:
+        /* Delete the corresponding lease, if it already exists */
         delete = true;
-        if (mac) {
-            /* Delete the corresponding lease, if it already exists */
-            delete = true;
-        }
         break;
 
     case VIR_LEASE_ACTION_INIT: