Skip to content

Commit da344a7

Browse files
committed
Replace ternary conditional with switch/case
1 parent 685dc82 commit da344a7

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/lib/ngsiNotify/Notifier.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,20 @@ SenderThreadParams* Notifier::buildSenderParams
794794
//
795795
// Note that disableCusNotif (taken from CLI) could disable custom notifications and force to use regular ones
796796
//
797-
bool custom = notification.type == ngsiv2::HttpNotification ? notification.httpInfo.custom : (notification.type == ngsiv2::MqttNotification ? notification.mqttInfo.custom : notification.kafkaInfo.custom);
797+
bool custom;
798+
switch (notification.type)
799+
{
800+
case ngsiv2::HttpNotification:
801+
custom = notification.httpInfo.custom;
802+
break;
803+
case ngsiv2::MqttNotification:
804+
custom = notification.mqttInfo.custom;
805+
break;
806+
default:
807+
custom = notification.kafkaInfo.custom;
808+
break;
809+
}
810+
798811
if (custom && !disableCusNotif)
799812
{
800813
return buildSenderParamsCustom(subId,

0 commit comments

Comments
 (0)