Minor optimization: wrapped a string fetch routine with #ifdef DEBUG, as the string's not actually used in this context for anything. Tripped across this as the HUDDisplay constantly queries for whether the OSD option is on, which in turn calls this string constructor/destructor on every draw.
This commit is contained in:
@@ -567,7 +567,9 @@ GameOption& GameSettings::operator[](int optionID)
|
||||
|
||||
GameOption* GameSettings::get(int optionID)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
string option_name = Options::getName(optionID);
|
||||
#endif
|
||||
|
||||
if (optionID < 0)
|
||||
return &invalid_option;
|
||||
|
||||
Reference in New Issue
Block a user