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:
Julian Brost 2025-03-31 12:58:20 +02:00
parent 061338156c
commit a1865e1b43

View File

@ -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();
}