[Paradiseo-help] [paradiseo-Bugs][7458] moeoArchive.update(const eoPop < MOEOT > & _pop) can be badly interpreted

paradiseo-bugs at gforge.inria.fr paradiseo-bugs at gforge.inria.fr
Jeu 12 Mar 17:24:33 CET 2009


Bugs item #7458, was opened at 12/03/2009 16:24
Status: Open
Priority: 1
Submitted By: Jérémie Humeau (jhumeau)
Assigned to: Jérémie Humeau (jhumeau)
Summary: moeoArchive.update(const eoPop < MOEOT > & _pop) can be badly interpreted  
Category: Compile
Group: 1.2.*
Resolution: None


Initial Comment:
In moeoArchive line 212:

    bool update(const eoPop < MOEOT > & _pop)
    {
    	bool res = false;
        for (unsigned int i=0; i<_pop.size(); i++)
        {
           res = (*this).update(_pop[i]) || res;
           -------------------------------------
        }
        return res;
    }

The underlined line can be badly interpreted: the fonction "(*this).update(_pop[i])" is not necessarily called!!!

Please replace that fonction by this one, then recompile:

    bool update(const eoPop < MOEOT > & _pop)
    {
	bool tmp = false;
    	bool res = false;
        for (unsigned int i=0; i<_pop.size(); i++)
        {
            tmp = (*this).update(_pop[i]);
            res = tmp || res;
        }
        return res;
    }

----------------------------------------------------------------------

You can respond by visiting: 
http://gforge.inria.fr/tracker/?func=detail&atid=663&aid=7458&group_id=145




Plus d'informations sur la liste de diffusion Paradiseo-help