Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove duplicated element
Signed-off-by: Thomas <thomas.burg@gmail.com>
  • Loading branch information
Thomasb81 committed Jul 7, 2024
1 parent b3bb743 commit f093677
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion runtime/Cpp/runtime/src/tree/xpath/XPath.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,13 @@ std::vector<ParseTree *> XPath::evaluate(ParseTree *t) {
}
}
i++;
work = next;
// remove duplicated element
work.clear();
for (unsigned int i=0; i < next.size(); i++ ){
if (std::find(work.begin(),work.end(),next[i]) == std::end(work)) {
work.push_back(next[i]);
}
}
}

return work;
Expand Down

0 comments on commit f093677

Please sign in to comment.