Skip to content

Commit

Permalink
1. Remove the unused capture. (#1474)
Browse files Browse the repository at this point in the history
2. correct the status assignment.
3. Using AND make the for loop terminal condition more clear.

Co-authored-by: dutor <440396+dutor@users.noreply.github.com>
  • Loading branch information
Shylock-Hg and dutor committed Dec 23, 2019
1 parent 13b1d30 commit f3f5cbd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions src/graph/GoExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ Status GoExecutor::prepareNeededProps() {
for (auto &entry : tagMap) {
auto tagId = ectx()->schemaManager()->toTagID(spaceId, entry.first);
if (!tagId.ok()) {
status == Status::Error("Tag `%s' not found.", entry.first.c_str());
status = Status::Error("Tag `%s' not found.", entry.first.c_str());
break;
}
entry.second = tagId.value();
Expand Down Expand Up @@ -983,7 +983,6 @@ void GoExecutor::onEmptyInputs() {

bool GoExecutor::processFinalResult(RpcResponse &rpcResp, Callback cb) const {
auto all = rpcResp.responses();
auto spaceId = ectx()->rctx()->session()->space();
for (auto &resp : all) {
if (resp.get_vertices() == nullptr) {
continue;
Expand Down Expand Up @@ -1029,7 +1028,6 @@ bool GoExecutor::processFinalResult(RpcResponse &rpcResp, Callback cb) const {
bool saveTypeFlag = false;
auto &getters = expCtx_->getters();
getters.getAliasProp = [&iter,
&spaceId,
&edgeType,
&saveTypeFlag,
&colTypes,
Expand Down Expand Up @@ -1080,7 +1078,7 @@ bool GoExecutor::processFinalResult(RpcResponse &rpcResp, Callback cb) const {
}
};
getters.getSrcTagProp =
[&iter, &spaceId, &tagData, &tagSchema, &saveTypeFlag, &colTypes, this](
[&iter, &tagData, &tagSchema, &saveTypeFlag, &colTypes, this](
const std::string &tag, const std::string &prop) -> OptVariantType {
TagID tagId;
auto found = expCtx_->getTagId(tag, tagId);
Expand Down Expand Up @@ -1114,7 +1112,7 @@ bool GoExecutor::processFinalResult(RpcResponse &rpcResp, Callback cb) const {
}
return value(res);
};
getters.getDstTagProp = [&iter, &spaceId, &saveTypeFlag, &colTypes, this](
getters.getDstTagProp = [&iter, &saveTypeFlag, &colTypes, this](
const std::string &tag,
const std::string &prop) -> OptVariantType {
auto dst = RowReader::getPropByName(&*iter, "_dst");
Expand Down
4 changes: 2 additions & 2 deletions src/meta/test/TestUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ class TestUtils {
}

for (auto resultIter = result.begin(), expectedIter = expected.begin();
resultIter != result.end(), expectedIter != expected.end();
resultIter != result.end() && expectedIter != expected.end();
resultIter++, expectedIter++) {
if (resultIter->first != expectedIter->first &&
!verifyResult(resultIter->second, expectedIter->second)) {
Expand All @@ -424,7 +424,7 @@ class TestUtils {
}

for (auto resultIter = result.begin(), expectedIter = expected.begin();
resultIter != result.end(), expectedIter != expected.end();
resultIter != result.end() && expectedIter != expected.end();
resultIter++, expectedIter++) {
if (resultIter->first != expectedIter->first &&
!verifyResult(resultIter->second, expectedIter->second)) {
Expand Down

0 comments on commit f3f5cbd

Please sign in to comment.