mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 07:04:37 +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);
|
ObjectLock hlock (host);
|
||||||
if (host->GetState() != HostUp) {
|
if (host->GetState() != HostUp) {
|
||||||
severity += 1024;
|
severity += 1024;
|
||||||
|
} else if (IsAcknowledged()) {
|
||||||
|
severity += 512;
|
||||||
|
} else if (IsInDowntime()) {
|
||||||
|
severity += 256;
|
||||||
} else {
|
} else {
|
||||||
if (IsAcknowledged())
|
severity += 2048;
|
||||||
severity += 512;
|
|
||||||
else if (IsInDowntime())
|
|
||||||
severity += 256;
|
|
||||||
else
|
|
||||||
severity += 2048;
|
|
||||||
}
|
}
|
||||||
hlock.Unlock();
|
hlock.Unlock();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user