Skip to content

Commit a3bc940

Browse files
committed
Remove duplicated element to math python3 runtime
1 parent b3bb743 commit a3bc940

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

runtime/Cpp/runtime/src/tree/xpath/XPath.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,13 @@ std::vector<ParseTree *> XPath::evaluate(ParseTree *t) {
147147
}
148148
}
149149
i++;
150-
work = next;
150+
// remove duplicated element
151+
work.clear();
152+
for (unsigned int i=0; i < next.size(); i++ ){
153+
if (std::find(work.begin(),work.end(),next[i]) == std::end(work)) {
154+
work.push_back(next[i]);
155+
}
156+
}
151157
}
152158

153159
return work;

0 commit comments

Comments
 (0)