Skip to content

Commit

Permalink
clang-format-10
Browse files Browse the repository at this point in the history
  • Loading branch information
wey-gu committed Mar 21, 2022
1 parent 02f4803 commit 325aced
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
19 changes: 9 additions & 10 deletions src/graph/visitor/VidExtractVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
*
* This source code is licensed under Apache 2.0 License.
*/
#include "graph/context/QueryContext.h"

#include "graph/visitor/VidExtractVisitor.h"

#include "graph/context/QueryContext.h"

#include "graph/util/ExpressionUtils.h"

namespace nebula {
Expand Down Expand Up @@ -167,10 +167,9 @@ void VidExtractVisitor::visit(RelationalExpression *expr) {
}

auto rightListValue = expr->right()->eval(graph::QueryExpressionContext(qctx_->ectx())());
vidPattern_ =
VidPattern{VidPattern::Special::kInUsed,
{{fCallExpr->args()->args().front()->toString(),
{VidPattern::Vids::Kind::kIn, rightListValue.getList()}}}};
vidPattern_ = VidPattern{VidPattern::Special::kInUsed,
{{fCallExpr->args()->args().front()->toString(),
{VidPattern::Vids::Kind::kIn, rightListValue.getList()}}}};
} else if (expr->kind() == Expression::Kind::kRelEQ) {
// id(V) == vid
if (expr->left()->kind() == Expression::Kind::kLabelAttribute) {
Expand Down Expand Up @@ -206,15 +205,15 @@ void VidExtractVisitor::visit(RelationalExpression *expr) {
return;
}
vidPattern_ = VidPattern{VidPattern::Special::kInUsed,
{{fCallExpr->args()->args().front()->toString(),
{VidPattern::Vids::Kind::kIn, List({constExpr->value()})}}}};
{{fCallExpr->args()->args().front()->toString(),
{VidPattern::Vids::Kind::kIn, List({constExpr->value()})}}}};
} else if (expr->right()->kind() == Expression::Kind::kVar &&
ExpressionUtils::isEvaluableExpr(expr->right(), qctx_)) {
auto rValue = expr->right()->eval(graph::QueryExpressionContext(qctx_->ectx())());
if (SchemaUtil::isValidVid(rValue)) {
vidPattern_ = VidPattern{VidPattern::Special::kInUsed,
{{fCallExpr->args()->args().front()->toString(),
{VidPattern::Vids::Kind::kIn, List({rValue})}}}};
{{fCallExpr->args()->args().front()->toString(),
{VidPattern::Vids::Kind::kIn, List({rValue})}}}};
return;
} else {
vidPattern_ = VidPattern{};
Expand Down
2 changes: 1 addition & 1 deletion src/graph/visitor/VidExtractVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include <memory>

#include "common/expression/ExprVisitor.h"
#include "graph/util/SchemaUtil.h"
#include "graph/context/QueryContext.h"
#include "graph/util/SchemaUtil.h"


namespace nebula {
Expand Down

0 comments on commit 325aced

Please sign in to comment.