mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
const&
-ify getcolorfromname
and getcrewmanfromname
This brings these functions into conforming code style and is a small performance optimization.
This commit is contained in:
parent
f23e99820f
commit
0edf0016d9
1 changed files with 2 additions and 2 deletions
|
@ -131,7 +131,7 @@ void scriptclass::tokenize( const std::string& t )
|
|||
}
|
||||
}
|
||||
|
||||
static int getcolorfromname(std::string name)
|
||||
static int getcolorfromname(const std::string& name)
|
||||
{
|
||||
if (name == "player") return CYAN;
|
||||
else if (name == "cyan") return CYAN;
|
||||
|
@ -149,7 +149,7 @@ static int getcolorfromname(std::string name)
|
|||
return color; // Last effort to give a valid color, maybe they just input the color?
|
||||
}
|
||||
|
||||
static int getcrewmanfromname(std::string name)
|
||||
static int getcrewmanfromname(const std::string& name)
|
||||
{
|
||||
if (name == "player") return obj.getplayer(); // Return the player
|
||||
int color = getcolorfromname(name); // Maybe they passed in a crewmate name, or an id?
|
||||
|
|
Loading…
Reference in a new issue