* Performance improvement for the deck editor when scrolling cards
  (transform 2*N*log(N)<Cmp1> + N*<read> into log(N)<Cmp1> +
  N*<read>). I expect this improvement to be much more significant,
  performance-wise, than last night's one.
This commit is contained in:
jean.chalard
2009-06-05 01:58:41 +00:00
parent c822b245c1
commit 01bd44025d
5 changed files with 21 additions and 25 deletions

View File

@@ -13,7 +13,6 @@ DeckDataWrapper::DeckDataWrapper(MTGDeck * deck){
Add(card);
}
currentposition = 0;
currentColor = -1;
}
@@ -159,19 +158,6 @@ MTGCard * DeckDataWrapper::getPrevious(MTGCard * next, int color){
}
}
void DeckDataWrapper::updateCurrentPosition(MTGCard * currentCard, int color){
currentposition = 0;
MTGCard * next = getNext(NULL,color);
while (next){
currentposition+=cards[next];
if (next == currentCard){
next = NULL;
}else{
next = getNext(next,color);
}
}
}
int DeckDataWrapper::getCount(int color){
if (color == -1) return colors[Constants::MTG_NB_COLORS];
return colors[color];
@@ -188,4 +174,4 @@ int DeckDataWrapper::totalPrice(){
}
delete pricelist;
return total;
}
}