0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-10 05:58:56 +02:00

ircd::mods: Use std map for mangles.

This commit is contained in:
Jason Volk 2019-02-08 23:18:46 -08:00
parent b4f09d06ec
commit e15045ea3f
2 changed files with 7 additions and 7 deletions

View file

@ -19,9 +19,9 @@ namespace ircd::mods
std::vector<std::string> symbols(const string_view &fullpath, const string_view &section);
std::vector<std::string> symbols(const string_view &fullpath);
std::unordered_map<std::string, std::string> mangles(const std::vector<std::string> &);
std::unordered_map<std::string, std::string> mangles(const string_view &fullpath, const string_view &section);
std::unordered_map<std::string, std::string> mangles(const string_view &fullpath);
std::map<std::string, std::string> mangles(const std::vector<std::string> &);
std::map<std::string, std::string> mangles(const string_view &fullpath, const string_view &section);
std::map<std::string, std::string> mangles(const string_view &fullpath);
// Find module names where symbol resides
bool has_symbol(const string_view &name, const string_view &symbol, const string_view &section = {});

View file

@ -819,23 +819,23 @@ ircd::mods::has_symbol(const string_view &name,
return std::find(begin(syms), end(syms), symbol) != end(syms);
}
std::unordered_map<std::string, std::string>
std::map<std::string, std::string>
ircd::mods::mangles(const string_view &path)
{
return mangles(mods::symbols(path));
}
std::unordered_map<std::string, std::string>
std::map<std::string, std::string>
ircd::mods::mangles(const string_view &path,
const string_view &section)
{
return mangles(mods::symbols(path, section));
}
std::unordered_map<std::string, std::string>
std::map<std::string, std::string>
ircd::mods::mangles(const std::vector<std::string> &symbols)
{
std::unordered_map<std::string, std::string> ret;
std::map<std::string, std::string> ret;
for(const auto &sym : symbols) try
{
ret.emplace(demangle(sym), sym);