J :
* 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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user