mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
Service::GetSeverity(): simplify nested if, add braces
No change in functionality, just making the code a bit nicer and more compact.
This commit is contained in:
parent
061338156c
commit
a1865e1b43
@ -139,13 +139,12 @@ int Service::GetSeverity() const
|
||||
ObjectLock hlock (host);
|
||||
if (host->GetState() != HostUp) {
|
||||
severity += 1024;
|
||||
} else if (IsAcknowledged()) {
|
||||
severity += 512;
|
||||
} else if (IsInDowntime()) {
|
||||
severity += 256;
|
||||
} else {
|
||||
if (IsAcknowledged())
|
||||
severity += 512;
|
||||
else if (IsInDowntime())
|
||||
severity += 256;
|
||||
else
|
||||
severity += 2048;
|
||||
severity += 2048;
|
||||
}
|
||||
hlock.Unlock();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user