Bug 751328

Summary: Logical expression in TemplateListModel could be simplified
Product: [Retired] oVirt Reporter: Laszlo Hornyak <lhornyak>
Component: ovirt-engine-coreAssignee: lpeer <lpeer>
Status: CLOSED WONTFIX QA Contact:
Severity: unspecified Docs Contact:
Priority: low    
Version: unspecifiedCC: dfediuck, iheim, lpeer, michal.skrivanek, Rhev-m-bugs, yeylon, ykaul
Target Milestone: ---Keywords: CodeChange
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: virt
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-12 10:43:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Laszlo Hornyak 2011-11-04 11:00:11 UTC
if (b.getid().equals(a.getid()) && (b.getstatus() == null ? StorageDomainStatus.InActive : b.getstatus()) == StorageDomainStatus.Active)

is equal to

if (b.getid().equals(a.getid()) && (b.getstatus() == StorageDomainStatus.Active))

while

if ((a.getstorage_domain_type() == StorageDomainType.Data || a.getstorage_domain_type() == StorageDomainType.Master) && templateNotExistInAnyDomain_iter && (a.getstatus() == null ? null : a.getstatus()) == StorageDomainStatus.Active)

is equal to

if ((a.getstorage_domain_type() == StorageDomainType.Data || a.getstorage_domain_type() == StorageDomainType.Master) && templateNotExistInAnyDomain_iter && a.getstatus() == StorageDomainStatus.Active)

somewhat shorter and probably more readable.

Comment 1 Itamar Heim 2012-12-12 10:43:42 UTC
Closing old bugs. If this issue is still relevant/important in current version, please re-open the bug.