1
0
Fork 0

Implemented unique edges on path for AQL traversal in cluster case

This commit is contained in:
Michael Hackstein 2015-12-15 17:26:03 +01:00
parent 6636dec958
commit f589308bd0
1 changed files with 15 additions and 1 deletions

View File

@ -209,8 +209,15 @@ void ClusterTraverser::EdgeGetter::operator() (std::string const& startVertex,
std::string next = stack.top(); std::string next = stack.top();
stack.pop(); stack.pop();
last = &_continueConst; last = &_continueConst;
result.push_back(next);
_traverser->_iteratorCache.emplace(stack); _traverser->_iteratorCache.emplace(stack);
auto search = std::find(result.begin(), result.end(), next);
if (search != result.end()) {
result.push_back(next);
// The edge is now included twice. Go on with the next
operator()(startVertex, result, last, eColIdx, unused);
return;
}
result.push_back(next);
} }
else { else {
if (_traverser->_iteratorCache.empty()) { if (_traverser->_iteratorCache.empty()) {
@ -228,6 +235,13 @@ void ClusterTraverser::EdgeGetter::operator() (std::string const& startVertex,
else { else {
std::string next = tmp.top(); std::string next = tmp.top();
tmp.pop(); tmp.pop();
auto search = std::find(result.begin(), result.end(), next);
if (search != result.end()) {
result.push_back(next);
// The edge is now included twice. Go on with the next
operator()(startVertex, result, last, eColIdx, unused);
return;
}
result.push_back(next); result.push_back(next);
} }
} }