* Improve loading performance by about 25%.
  - This is certainly not the kind of change I was aiming at, but it
    just happened to get done, so why not commit it.
  - Little point for users in this change actually, since the loading
    times get down from 15 to 11 secs or so, it's not even that
    obvious.
  - I get about 25% on my PSP. Valgrind reports 36% improvement on PC.
    I wish it was the opposite ;_;
  - Feedback welcome
This commit is contained in:
jean.chalard
2010-06-08 17:42:35 +00:00
parent dfca20c90b
commit fc9fccd93b
4 changed files with 180 additions and 216 deletions

View File

@@ -109,11 +109,10 @@ private:
int countByType(const char * _type);
int countByColor(int color);
int countBySet(int setId);
int readConfLine(ifstream &file, int set_id);
int totalCards();
int randomCardId();
private:
int processConfLine(string s, MTGCard* card, CardPrimitive * primitive);
int processConfLine(string &s, MTGCard* card, CardPrimitive * primitive);
bool addCardToCollection(MTGCard * card, int setId);
CardPrimitive * addPrimitive(CardPrimitive * primitive, MTGCard * card = NULL);
};