Skip to content

Commit

Permalink
change string to folly:StringPiece for srcID and dstID.
Browse files Browse the repository at this point in the history
  • Loading branch information
xtcyclist committed Nov 30, 2022
1 parent 3ec53c9 commit e02b240
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/storage/exec/GetNeighborsNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,15 @@ class GetNeighborsNode : public QueryNode<VertexID> {
}

bool isDuplicatedSelfReflectiveEdge(const folly::StringPiece& key) {
std::string srcID = NebulaKeyUtils::getSrcId(context_->vIdLen(), key).str();
std::string dstID = NebulaKeyUtils::getDstId(context_->vIdLen(), key).str();
if (srcID.compare(dstID) == 0) {
folly::StringPiece srcID = NebulaKeyUtils::getSrcId(context_->vIdLen(), key);
folly::StringPiece dstID = NebulaKeyUtils::getDstId(context_->vIdLen(), key);
if (srcID == dstID) {
// self-reflective edge
std::string rank = std::to_string(NebulaKeyUtils::getRank(context_->vIdLen(), key));
auto edgeType = NebulaKeyUtils::getEdgeType(context_->vIdLen(), key);
edgeType = edgeType > 0 ? edgeType : -edgeType;
std::string type = std::to_string(edgeType);
std::string localKey = type + rank + srcID;
std::string localKey = type + rank + srcID.str();
if (!visitedSelfReflectiveEdges_.insert(localKey).second) {
return true;
}
Expand Down

0 comments on commit e02b240

Please sign in to comment.