From d7049a67b6e6e3ba2bfe900686acc9bb5e2458da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Thu, 14 Jan 2016 16:49:56 +0100 Subject: [PATCH] leaseshelper: remove useless comparison 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 | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/network/leaseshelper.c b/src/network/leaseshelper.c index 1e5e3e80c8..eb1c0c78e5 100644 --- a/src/network/leaseshelper.c +++ b/src/network/leaseshelper.c @@ -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: -- GitLab