Optimize parameter passing to avoid unnecessary copying

This commit is contained in:
Pugemon 2024-06-07 03:58:20 +03:00
parent 46ca1bb04a
commit f25a425cb9
123 changed files with 578 additions and 522 deletions

View file

@ -40,7 +40,7 @@ void scripting::on_frontend_close() {
scripting::hud = nullptr;
}
void scripting::load_hud_script(scriptenv senv, std::string packid, fs::path file) {
void scripting::load_hud_script(const scriptenv& senv, const std::string& packid, const fs::path& file) {
int env = *senv;
std::string src = files::read_string(file);
logger.info() << "loading script " << file.u8string();