Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yixinglu committed Nov 23, 2020
1 parent 0077f03 commit f2d5b35
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/common/expression/PathBuildExpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ const Value& PathBuildExpression::eval(ExpressionContext& ctx) {
}
path.steps.insert(path.steps.end(), p.steps.begin(), p.steps.end());
} else {
if ((i & 1) == 1) {
return Value::kNullBadData;
}
if (path.steps.empty() || !getVertex(value, path.steps.back().dst)) {
if ((i & 1) == 1 || path.steps.empty() || !getVertex(value, path.steps.back().dst)) {
return Value::kNullBadData;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/common/function/FunctionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ std::unordered_map<std::string, std::vector<TypeSignature>> FunctionManager::typ
{"head", {TypeSignature({Value::Type::LIST}, Value::Type::__EMPTY__), }},
{"last", { TypeSignature({Value::Type::LIST}, Value::Type::__EMPTY__), }},
{"coalesce", { TypeSignature({Value::Type::LIST}, Value::Type::__EMPTY__), }},
{"cyclePath", { TypeSignature({Value::Type::PATH}, Value::Type::BOOL), }},
{"hasSameEdgeInPath", { TypeSignature({Value::Type::PATH}, Value::Type::BOOL), }},
};

// static
Expand Down Expand Up @@ -1190,7 +1190,7 @@ FunctionManager::FunctionManager() {
};
}
{
auto &attr = functions_["cyclePath"];
auto &attr = functions_["hasSameEdgeInPath"];
attr.minArity_ = 1;
attr.maxArity_ = 1;
attr.isPure_ = true;
Expand Down

0 comments on commit f2d5b35

Please sign in to comment.