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:
wrenczes@gmail.com
2011-04-09 21:08:46 +00:00
parent 357f86459a
commit 62da8e7ad8

View File

@@ -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;