Skip to content

Commit

Permalink
[Examples] Remove identical condition (#25660)
Browse files Browse the repository at this point in the history
* Removed identical condition

* Optimized return statements
  • Loading branch information
ReneJosefsen authored and pull[bot] committed Jan 19, 2024
1 parent db3569f commit 3290607
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/pump-app/nrfconnect/main/PumpManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ void PumpManager::SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callba

bool PumpManager::IsActionInProgress()
{
return (mState == kState_StartInitiated || mState == kState_StartInitiated) ? true : false;
return (mState == kState_StartInitiated);
}

bool PumpManager::IsStopped()
{
return (mState == kState_StopCompleted) ? true : false;
return (mState == kState_StopCompleted);
}

void PumpManager::EnableAutoRestart(bool aOn)
Expand Down
4 changes: 2 additions & 2 deletions examples/pump-controller-app/nrfconnect/main/PumpManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ void PumpManager::SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callba

bool PumpManager::IsActionInProgress()
{
return (mState == kState_StartInitiated || mState == kState_StartInitiated) ? true : false;
return (mState == kState_StartInitiated);
}

bool PumpManager::IsStopped()
{
return (mState == kState_StopCompleted) ? true : false;
return (mState == kState_StopCompleted);
}

void PumpManager::EnableAutoRestart(bool aOn)
Expand Down

0 comments on commit 3290607

Please sign in to comment.