Allon Mureinik has uploaded a new change for review. Change subject: core: VmRunHandler: simplify isInternal evaluation ......................................................................
core: VmRunHandler: simplify isInternal evaluation Some of the checks in VmRunHandler are only evaluated in the following condition: !vm.isAutoStartup() || !runParams.getIsInternal() && vm.isAutoStartup() Since java evaluated boolean conditions with short circuit logic, this can be simplified. The right hand of the || condition is only tested if !vm.isAutoStartup() evaluates to fale, which means vm.isAutoStartup evaluated to true - so there is no reason to test it again. The added readability is a bonus. Change-Id: I0aa0ce3b0ef22739014f31f4019a35b8d230aaee Signed-off-by: Allon Mureinik <amure...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmRunHandler.java 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/48/12248/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmRunHandler.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmRunHandler.java index 38f372c..48a95f4 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmRunHandler.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmRunHandler.java @@ -254,8 +254,8 @@ return ImagesHandler.PerformImagesChecks(message, vm.getStoragePoolId(), Guid.Empty, !vm.isAutoStartup(), true, false, false, - !vm.isAutoStartup() || !runParams.getIsInternal() && vm.isAutoStartup(), - !vm.isAutoStartup() || !runParams.getIsInternal() && vm.isAutoStartup(), + !vm.isAutoStartup() || !runParams.getIsInternal(), + !vm.isAutoStartup() || !runParams.getIsInternal(), vmDisks); } -- To view, visit http://gerrit.ovirt.org/12248 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0aa0ce3b0ef22739014f31f4019a35b8d230aaee Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Allon Mureinik <amure...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches