Minor code cleanup - pass by reference instead of value; instead of creating temp char arrays on each deck loop while building deck metadata, use an ostringstream when needed.

This commit is contained in:
wrenczes@gmail.com
2010-11-07 03:55:56 +00:00
parent 416617fc0d
commit b14e3808db
4 changed files with 38 additions and 46 deletions

View File

@@ -66,19 +66,19 @@ class GameState
// it makes it easier to manipulate the deck information menus.
// generate the Deck Meta Data and build the menu items of the menu given
static vector<DeckMetaData *> fillDeckMenu(SimpleMenu * _menu, string path, string smallDeckPrefix = "", Player * statsPlayer = NULL);
static vector<DeckMetaData *> fillDeckMenu(SimpleMenu * _menu, const string& path, const string& smallDeckPrefix = "", Player * statsPlayer = NULL);
// generate the Deck Meta Data and build the menu items of the menu given
static vector<DeckMetaData *> fillDeckMenu(DeckMenu * _menu, string path, string smallDeckPrefix = "", Player * statsPlayer = NULL);
static vector<DeckMetaData *> fillDeckMenu(DeckMenu * _menu, const string& path, const string& smallDeckPrefix = "", Player * statsPlayer = NULL);
// build a vector of decks with the information passsed in.
static vector<DeckMetaData *> getValidDeckMetaData(string path, string smallDeckPrefix = "", Player * statsPlayer = NULL);
static vector<DeckMetaData *> getValidDeckMetaData(const string& path, const string& smallDeckPrefix = "", Player * statsPlayer = NULL);
// build menu items based on the vector<DeckMetaData *>
static void renderDeckMenu(SimpleMenu * _menu, vector<DeckMetaData *> deckMetaDataList);
static void renderDeckMenu(SimpleMenu * _menu, const vector<DeckMetaData *>& deckMetaDataList);
// build menu items based on the vector<DeckMetaData *>
static void renderDeckMenu(DeckMenu * _menu, vector<DeckMetaData *> deckMetaDataList);
static void renderDeckMenu(DeckMenu * _menu, const vector<DeckMetaData *>& deckMetaDataList);
};
bool sortByName( DeckMetaData * d1, DeckMetaData * d2 );