mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-24 05:15:22 +02:00
mods.cpp/h: little performance improvement in getModsInPath (+ codestyle) (#7108)
* mods.cpp/h: little performance improvement in getModsInPath
This commit is contained in:
10
src/mods.h
10
src/mods.h
@@ -45,16 +45,22 @@ struct ModSpec
|
||||
bool is_modpack = false;
|
||||
// if modpack:
|
||||
std::map<std::string,ModSpec> modpack_content;
|
||||
ModSpec(const std::string &name_="", const std::string &path_=""):
|
||||
ModSpec(const std::string &name_ = "", const std::string &path_ = ""):
|
||||
name(name_),
|
||||
path(path_)
|
||||
{}
|
||||
ModSpec(const std::string &name_, const std::string &path_, bool part_of_modpack_):
|
||||
name(name_),
|
||||
path(path_),
|
||||
part_of_modpack(part_of_modpack_)
|
||||
{}
|
||||
};
|
||||
|
||||
// Retrieves depends, optdepends, is_modpack and modpack_content
|
||||
void parseModContents(ModSpec &mod);
|
||||
|
||||
std::map<std::string,ModSpec> getModsInPath(std::string path, bool part_of_modpack = false);
|
||||
std::map<std::string,ModSpec> getModsInPath(const std::string &path,
|
||||
bool part_of_modpack = false);
|
||||
|
||||
// replaces modpack Modspecs with their content
|
||||
std::vector<ModSpec> flattenMods(std::map<std::string,ModSpec> mods);
|
||||
|
||||
Reference in New Issue
Block a user