summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kutsan <akutsan@luxoft.com>2017-11-15 18:17:07 +0200
committerAlexander Kutsan <akutsan@luxoft.com>2017-11-15 18:17:07 +0200
commit931ce35d5d13fca2a6907f3c1bbbc21f1fa56483 (patch)
tree26e106f042845d851062a3da59cee77c25196981
parent1caf831f14c8a5f9aabea822dfba5c646376d278 (diff)
downloadsdl_core-931ce35d5d13fca2a6907f3c1bbbc21f1fa56483.tar.gz
Optimize using of CheckResultCode
Move additional checks from PrepareResultForMobileResponse to CheckResultCode
-rw-r--r--src/components/application_manager/src/commands/command_request_impl.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/components/application_manager/src/commands/command_request_impl.cc b/src/components/application_manager/src/commands/command_request_impl.cc
index 473a2d04a0..09aa4169e5 100644
--- a/src/components/application_manager/src/commands/command_request_impl.cc
+++ b/src/components/application_manager/src/commands/command_request_impl.cc
@@ -109,6 +109,12 @@ bool CheckResultCode(const ResponseInfo& first, const ResponseInfo& second) {
if (first.is_ok && second.is_unsupported_resource) {
return true;
}
+ if (first.is_ok && second.is_not_used) {
+ return true;
+ }
+ if (first.is_ok && second.is_ok) {
+ return true;
+ }
return false;
}
@@ -818,11 +824,8 @@ bool CommandRequestImpl::PrepareResultForMobileResponse(
bool CommandRequestImpl::PrepareResultForMobileResponse(
ResponseInfo& out_first, ResponseInfo& out_second) const {
LOG4CXX_AUTO_TRACE(logger_);
- bool result = (out_first.is_ok && out_second.is_ok) ||
- (out_first.is_ok && out_second.is_not_used) ||
- (out_second.is_ok && out_first.is_not_used);
- result = result || CheckResultCode(out_first, out_second);
- result = result || CheckResultCode(out_second, out_first);
+ bool result = CheckResultCode(out_first, out_second) ||
+ CheckResultCode(out_second, out_first);
return result;
}