mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 23:24:09 +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) {
|
} else if (state == ServiceOK) {
|
||||||
severity = 0;
|
severity = 0;
|
||||||
} else {
|
} else {
|
||||||
switch (state) {
|
if (state == ServiceWarning) {
|
||||||
case ServiceWarning:
|
severity = 32;
|
||||||
severity = 32;
|
} else if (state == ServiceUnknown) {
|
||||||
break;
|
severity = 64;
|
||||||
case ServiceUnknown:
|
} else if (state == ServiceCritical) {
|
||||||
severity = 64;
|
severity = 128;
|
||||||
break;
|
} else {
|
||||||
case ServiceCritical:
|
severity = 256;
|
||||||
severity = 128;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
severity = 256;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Host::Ptr host = GetHost();
|
Host::Ptr host = GetHost();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user