From 7e3b497ef879a6a82b5c6d48577cd7bc541ee854 Mon Sep 17 00:00:00 2001 From: APN-Pucky Date: Sun, 9 Sep 2018 23:10:16 +0200 Subject: [PATCH] Flexible Speedup Release --- deck.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/deck.cpp b/deck.cpp index a70977b1..27c91c9e 100644 --- a/deck.cpp +++ b/deck.cpp @@ -593,20 +593,19 @@ const Card* Deck::next(Field* f) shuffled_cards.pop_front(); return(card); } - for(unsigned j =0; j < res.size();j++) - { - bool repeat{false}; - for(unsigned k=0;km_id==shuffled_cards.begin()[k]->m_id) - { - res[j]=res[k]; - repeat=true; - } - } - if(repeat)continue; + for(unsigned j =0; j < res.size();j++) + { + bool repeat{false}; + for(unsigned k=0;km_id==shuffled_cards.begin()[k]->m_id) + { + res[j]=res[k]; //copy prev result + repeat=true; + break; + } + } + if(repeat)continue; //skip resim for(unsigned i =0; i < iter;i++) { //copy hand