Use a list instead of a set for node names list

Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
This commit is contained in:
Emerson Knapp 2020-03-10 17:47:07 -07:00 committed by eboasson
parent a6deecfceb
commit 8e8b1ff044

View file

@ -2884,14 +2884,14 @@ extern "C" rmw_ret_t rmw_get_node_names(
return RMW_RET_ERROR; return RMW_RET_ERROR;
} }
std::set<std::pair<std::string, std::string>> ns; std::vector<std::pair<std::string, std::string>> ns;
const auto re = std::regex("^name=(.*);namespace=(.*);$", std::regex::extended); const auto re = std::regex("^name=(.*);namespace=(.*);$", std::regex::extended);
auto oper = auto oper =
[&ns, re](const dds_builtintopic_participant_t & sample, const char * ud) -> bool { [&ns, re](const dds_builtintopic_participant_t & sample, const char * ud) -> bool {
std::cmatch cm; std::cmatch cm;
static_cast<void>(sample); static_cast<void>(sample);
if (std::regex_search(ud, cm, re)) { if (std::regex_search(ud, cm, re)) {
ns.insert(std::make_pair(std::string(cm[1]), std::string(cm[2]))); ns.push_back(std::make_pair(std::string(cm[1]), std::string(cm[2])));
} }
return true; return true;
}; };