Skip to content

Commit

Permalink
refactor: if
Browse files Browse the repository at this point in the history
Signed-off-by: kobayu858 <[email protected]>
  • Loading branch information
kobayu858 committed Dec 26, 2024
1 parent cc46392 commit f06639e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions system/mrm_handler/src/mrm_handler/mrm_handler_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,17 @@ void MrmHandler::operateMrm()
if (current_mrm_behavior == mrm_state_.behavior) {
return;
}
if (requestMrmBehavior(current_mrm_behavior, RequestType::CALL)) {
mrm_state_.behavior = current_mrm_behavior;
} else {
// First: cancel the previous behavior
if (!requestMrmBehavior(mrm_state_.behavior, RequestType::CANCEL)) {
handleFailedRequest();
return;

Check warning on line 190 in system/mrm_handler/src/mrm_handler/mrm_handler_core.cpp

View check run for this annotation

Codecov / codecov/patch

system/mrm_handler/src/mrm_handler/mrm_handler_core.cpp#L190

Added line #L190 was not covered by tests
}
// Second: call the current behavior
if (!requestMrmBehavior(current_mrm_behavior, RequestType::CALL)) {
handleFailedRequest();
return;

Check warning on line 195 in system/mrm_handler/src/mrm_handler/mrm_handler_core.cpp

View check run for this annotation

Codecov / codecov/patch

system/mrm_handler/src/mrm_handler/mrm_handler_core.cpp#L195

Added line #L195 was not covered by tests
}
mrm_state_.behavior = current_mrm_behavior;

Check warning on line 197 in system/mrm_handler/src/mrm_handler/mrm_handler_core.cpp

View check run for this annotation

Codecov / codecov/patch

system/mrm_handler/src/mrm_handler/mrm_handler_core.cpp#L197

Added line #L197 was not covered by tests
return;
}
if (mrm_state_.state == MrmState::MRM_SUCCEEDED) {
Expand Down

0 comments on commit f06639e

Please sign in to comment.