Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
nevermore3 committed Apr 12, 2022
1 parent b4123bf commit c03e5c8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/graph/executor/algo/BFSShortestPathExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ folly::Future<Status> BFSShortestPathExecutor::conjunctPath() {
});
}

DataSet BFSShortestPathExecutor::doConjunct(const std::vector<Value> meetVids, bool oddStep) {
DataSet BFSShortestPathExecutor::doConjunct(const std::vector<Value>& meetVids,
bool oddStep) const {
DataSet ds;
auto leftPaths = createPath(meetVids, false, oddStep);
auto rightPaths = createPath(meetVids, true, oddStep);
Expand All @@ -171,7 +172,7 @@ DataSet BFSShortestPathExecutor::doConjunct(const std::vector<Value> meetVids, b
}

std::unordered_multimap<Value, Path> BFSShortestPathExecutor::createPath(
std::vector<Value> meetVids, bool reverse, bool oddStep) {
std::vector<Value> meetVids, bool reverse, bool oddStep) const {
std::unordered_multimap<Value, Path> result;
auto& allEdges = reverse ? allRightEdges_ : allLeftEdges_;
for (auto& meetVid : meetVids) {
Expand Down
4 changes: 2 additions & 2 deletions src/graph/executor/algo/BFSShortestPathExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ class BFSShortestPathExecutor final : public Executor {

folly::Future<Status> conjunctPath();

DataSet doConjunct(const std::vector<Value> meetVids, bool oddStep);
DataSet doConjunct(const std::vector<Value>& meetVids, bool oddStep) const;

std::unordered_multimap<Value, Path> createPath(std::vector<Value> meetVids,
bool reverse,
bool oddStep);
bool oddStep) const;

private:
const BFSShortestPath* pathNode_{nullptr};
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/algo/ProduceAllPathsExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Status ProduceAllPathsExecutor::buildPath(bool reverse) {

DataSet ProduceAllPathsExecutor::doConjunct(Interims::iterator startIter,
Interims::iterator endIter,
bool oddStep) {
bool oddStep) const {
auto& rightPaths = oddStep ? preRightPaths_ : rightPaths_;
DataSet ds;
for (; startIter != endIter; ++startIter) {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/algo/ProduceAllPathsExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ProduceAllPathsExecutor final : public Executor {

Status buildPath(bool reverse);
folly::Future<Status> conjunctPath();
DataSet doConjunct(Interims::iterator startIter, Interims::iterator endIter, bool oddStep);
DataSet doConjunct(Interims::iterator startIter, Interims::iterator endIter, bool oddStep) const;
void setNextStepVid(Interims& paths, const string& var);

private:
Expand Down

0 comments on commit c03e5c8

Please sign in to comment.