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 Mar 15, 2023
1 parent 8395455 commit 12bcb2c
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 12bcb2c

Please sign in to comment.