Optimize parameter passing to avoid unnecessary copying

This commit is contained in:
Pugemon
2024-06-07 04:00:38 +03:00
parent 46ca1bb04a
commit f25a425cb9
123 changed files with 578 additions and 522 deletions
+7 -7
View File
@@ -22,21 +22,21 @@ class ContentLoader {
const ContentPack* pack;
scriptenv env;
void loadBlock(Block& def, std::string full, std::string name);
void loadBlock(Block& def, const std::string& full, const std::string& name);
void loadCustomBlockModel(Block& def, dynamic::Map* primitives);
void loadItem(ItemDef& def, std::string full, std::string name);
void loadBlockMaterial(BlockMaterial& def, fs::path file);
void loadItem(ItemDef& def, const std::string& full, const std::string& name);
void loadBlockMaterial(BlockMaterial& def, const fs::path& file);
public:
ContentLoader(ContentPack* pack);
bool fixPackIndices(
fs::path folder,
const fs::path& folder,
dynamic::Map* indicesRoot,
std::string contentSection
const std::string& contentSection
);
void fixPackIndices();
void loadBlock(Block& def, std::string name, fs::path file);
void loadItem(ItemDef& def, std::string name, fs::path file);
void loadBlock(Block& def, const std::string& name, const fs::path& file);
void loadItem(ItemDef& def, const std::string& name, const fs::path& file);
void load(ContentBuilder& builder);
};