mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-31 02:14:09 +03:00
Use const std::string& where possible in function params
If it's at all possible to use `const std::string&` when passing `std::string`s around, then we use it. This is to limit the amount of memory usage as a result of the frequent use of `std::string`s, so the game no longer unnecessarily copies strings when it doesn't need to.
This commit is contained in:
@@ -246,7 +246,7 @@ void customlevelclass::getDirectoryData(void)
|
||||
}
|
||||
|
||||
}
|
||||
bool customlevelclass::getLevelMetaData(std::string& _path, LevelMetaData& _data )
|
||||
bool customlevelclass::getLevelMetaData(const std::string& _path, LevelMetaData& _data )
|
||||
{
|
||||
unsigned char *uMem;
|
||||
FILESYSTEM_loadFileToMemory(_path.c_str(), &uMem, NULL, true);
|
||||
@@ -1264,7 +1264,7 @@ fail:
|
||||
}
|
||||
|
||||
#ifndef NO_EDITOR
|
||||
bool customlevelclass::save(std::string& _path)
|
||||
bool customlevelclass::save(const std::string& _path)
|
||||
{
|
||||
tinyxml2::XMLDocument doc;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user