Skip to content

Commit f093677

Browse files
committed
Remove duplicated element Signed-off-by: Thomas <[email protected]>
1 parent b3bb743 commit f093677

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: runtime/Cpp/runtime/src/tree/xpath/XPath.cpp

100755100644
+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)