mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-08 18:09:45 +01:00
Pass input of UtilityClass::GCString() by const reference
This avoids an unnecessary copy of the input std::vector, since we don't need to modify it for anything. This cuts down on unnecessary memory operations.
This commit is contained in:
parent
46b0257cf1
commit
06cc5afe27
2 changed files with 2 additions and 2 deletions
|
@ -119,7 +119,7 @@ int UtilityClass::Int(const char* str, int fallback /*= 0*/)
|
|||
return (int) SDL_strtol(str, NULL, 0);
|
||||
}
|
||||
|
||||
std::string UtilityClass::GCString(std::vector<SDL_GameControllerButton> buttons)
|
||||
std::string UtilityClass::GCString(const std::vector<SDL_GameControllerButton>& buttons)
|
||||
{
|
||||
std::string retval = "";
|
||||
for (size_t i = 0; i < buttons.size(); i += 1)
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
|
||||
static int Int(const char* str, int fallback = 0);
|
||||
|
||||
static std::string GCString(std::vector<SDL_GameControllerButton> buttons);
|
||||
static std::string GCString(const std::vector<SDL_GameControllerButton>& buttons);
|
||||
|
||||
std::string twodigits(int t);
|
||||
|
||||
|
|
Loading…
Reference in a new issue