From 23a0dd19d399d81f9ada485eab510f8352799c4b Mon Sep 17 00:00:00 2001 From: Avi Date: Fri, 27 Jan 2023 12:20:21 +1000 Subject: [PATCH] Fix #145, Refactor mutually exclusive logic in if, else if block --- fsw/src/to_lab_app.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fsw/src/to_lab_app.c b/fsw/src/to_lab_app.c index 17e2660..8ad9f39 100644 --- a/fsw/src/to_lab_app.c +++ b/fsw/src/to_lab_app.c @@ -202,16 +202,16 @@ int32 TO_LAB_init(void) /* Subscriptions for TLM pipe*/ for (i = 0; (i < (sizeof(TO_LAB_Subs->Subs) / sizeof(TO_LAB_Subs->Subs[0]))); i++) { - if (!CFE_SB_IsValidMsgId(TO_LAB_Subs->Subs[i].Stream)) - { - /* Only process until invalid MsgId (aka TO_LAB_UNUSED) is found*/ - break; - } - else if (CFE_SB_IsValidMsgId(TO_LAB_Subs->Subs[i].Stream)) + if (CFE_SB_IsValidMsgId(TO_LAB_Subs->Subs[i].Stream)) { status = CFE_SB_SubscribeEx(TO_LAB_Subs->Subs[i].Stream, TO_LAB_Global.Tlm_pipe, TO_LAB_Subs->Subs[i].Flags, TO_LAB_Subs->Subs[i].BufLimit); } + else + { + /* Only process until invalid MsgId (aka TO_LAB_UNUSED) is found*/ + break; + } if (status != CFE_SUCCESS) CFE_EVS_SendEvent(TO_LAB_SUBSCRIBE_ERR_EID, CFE_EVS_EventType_ERROR,