Entity* Entity::Find(char* name)
{
if(childs)
{
Telist::const_iterator ei;
Telist::const_iterator endi=childs.end();
for(ei=childs.begin();ei!=endi;++ei)
{
if(strcmp((*ei)->GetName(),name)==0 ){return (*ei);}
else
{
[b]Entity *tmp;
tmp = (*ei)->Find(name);
if(tmp!=NULL)return tmp;[/b]
}
}
}
return NULL;
}
выделен нехороший участок. (мне кажется) что от лишней временной переменной можно избавится, но никак не соображу как (

Помощь




