@@ -11,21 +11,20 @@ namespace nebula {
11
11
namespace graph {
12
12
class SingleShortestPath final : public ShortestPathBase {
13
13
public:
14
+ using HashSet = robin_hood::unordered_flat_set<Value, std::hash<Value>>;
14
15
SingleShortestPath (const ShortestPath* node,
15
16
QueryContext* qctx,
16
17
std::unordered_map<std::string, std::string>* stats)
17
18
: ShortestPathBase(node, qctx, stats) {}
18
19
19
- folly::Future<Status> execute (const std::unordered_set<Value> & startVids,
20
- const std::unordered_set<Value> & endVids,
20
+ folly::Future<Status> execute (const HashSet & startVids,
21
+ const HashSet & endVids,
21
22
DataSet* result) override ;
22
23
23
24
using HalfPath = std::vector<std::unordered_map<DstVid, std::vector<CustomStep>>>;
24
25
25
26
private:
26
- void init (const std::unordered_set<Value>& startVids,
27
- const std::unordered_set<Value>& endVids,
28
- size_t rowSize);
27
+ void init (const HashSet& startVids, const HashSet& endVids, size_t rowSize);
29
28
30
29
folly::Future<Status> shortestPath (size_t rowNum, size_t stepNum);
31
30
@@ -48,8 +47,8 @@ class SingleShortestPath final : public ShortestPathBase {
48
47
std::vector<Row> createLeftPath (size_t rowNum, const Value& meetVid);
49
48
50
49
private:
51
- std::vector<std::unordered_set<Value> > leftVisitedVids_;
52
- std::vector<std::unordered_set<Value> > rightVisitedVids_;
50
+ std::vector<HashSet > leftVisitedVids_;
51
+ std::vector<HashSet > rightVisitedVids_;
53
52
std::vector<HalfPath> allLeftPaths_;
54
53
std::vector<HalfPath> allRightPaths_;
55
54
};
0 commit comments