mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 01:48:15 +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:
@@ -5012,7 +5012,7 @@ void Game::readmaingamesave(const char* savename, tinyxml2::XMLDocument& doc)
|
||||
|
||||
}
|
||||
|
||||
void Game::customloadquick(std::string savfile)
|
||||
void Game::customloadquick(const std::string& savfile)
|
||||
{
|
||||
tinyxml2::XMLDocument doc;
|
||||
tinyxml2::XMLHandle hDoc(&doc);
|
||||
@@ -5541,7 +5541,7 @@ std::string Game::writemaingamesave(tinyxml2::XMLDocument& doc)
|
||||
}
|
||||
|
||||
|
||||
bool Game::customsavequick(std::string savfile)
|
||||
bool Game::customsavequick(const std::string& savfile)
|
||||
{
|
||||
const std::string levelfile = savfile.substr(7);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user