--- queensgui/src/solutionhash.cpp 2007/07/19 21:34:15 1 +++ queensgui/src/solutionhash.cpp 2007/07/19 22:26:42 2 @@ -101,17 +101,17 @@ if (m_halt) return; match_count = 0; - Solution tmp(*i); + Solution* tmp = (*i)->copy(); if (mirror) - tmp.mirror(); + tmp->mirror(); for (int k=0;krotate90(); //unders�g kun resten af m�ngden, start ved i+1 ListIt j =i; j++; for ( ; j!=solutions[bucket]->end();j++) { - if ( tmp == (*j) ) { + if ( *tmp == *(*j) ) { solutions[bucket]->erase(j); break; } @@ -150,23 +150,22 @@ } */ -void SolutionHash::addSolution(Solution sol) +void SolutionHash::addSolution(Solution* sol) { int hash = m_size % max_size; solutions[hash]->push_back(sol); m_size++; } -Solution SolutionHash::solution(int index) +Solution* SolutionHash::solution(int index) { int count=0; - Solution returndata; - for (ListIt it = solutions[0]->begin(); it != solutions[0]->end(); it++, count++) { + ListIt it; + for (it = solutions[0]->begin(); it != solutions[0]->end(); it++, count++) { if (count == index) { - returndata = *it ; - break; - } + break; + } } - return returndata; + return *it; }