Skip to content

Commit

Permalink
Fix #145, Refactor mutually exclusive logic in if, else if block
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Jan 27, 2023
1 parent 7ca124c commit 23a0dd1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions fsw/src/to_lab_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 23a0dd1

Please sign in to comment.