mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
Service::GetSeverity(): replace switch with if
No change in functionality, just making the code a bit more compact.
This commit is contained in:
parent
a1865e1b43
commit
5ca6047b35
@ -121,18 +121,14 @@ int Service::GetSeverity() const
|
||||
} else if (state == ServiceOK) {
|
||||
severity = 0;
|
||||
} else {
|
||||
switch (state) {
|
||||
case ServiceWarning:
|
||||
severity = 32;
|
||||
break;
|
||||
case ServiceUnknown:
|
||||
severity = 64;
|
||||
break;
|
||||
case ServiceCritical:
|
||||
severity = 128;
|
||||
break;
|
||||
default:
|
||||
severity = 256;
|
||||
if (state == ServiceWarning) {
|
||||
severity = 32;
|
||||
} else if (state == ServiceUnknown) {
|
||||
severity = 64;
|
||||
} else if (state == ServiceCritical) {
|
||||
severity = 128;
|
||||
} else {
|
||||
severity = 256;
|
||||
}
|
||||
|
||||
Host::Ptr host = GetHost();
|
||||
|
Loading…
x
Reference in New Issue
Block a user