* eoOpContainer: call to eoGenOp::apply instead of operator() to avoid calling reserve

This commit is contained in:
Caner Candan 2011-03-30 15:52:23 +02:00
commit f984839366

View file

@ -100,6 +100,8 @@ public:
void apply(eoPopulator<EOT>& _pop) { void apply(eoPopulator<EOT>& _pop) {
_pop.reserve( this->max_production() );
position_type pos = _pop.tellp(); position_type pos = _pop.tellp();
for (size_t i = 0; i < rates.size(); ++i) { for (size_t i = 0; i < rates.size(); ++i) {
_pop.seekp(pos); _pop.seekp(pos);
@ -108,7 +110,11 @@ public:
// try // try
// { // {
// apply it to all the guys in the todo std::list // apply it to all the guys in the todo std::list
(*ops[i])(_pop);
//(*ops[i])(_pop);
ops[i]->apply(_pop);
// } // }
// check for out of individuals and do nothing with that... // check for out of individuals and do nothing with that...
// catch(eoPopulator<EOT>::OutOfIndividuals&) // catch(eoPopulator<EOT>::OutOfIndividuals&)