Consider the following.
bool Controller::execute(char* data_) {
if(data_==NULL) {
return false ;
}
if(_manager==NULL) {
return false ;
}
Object* obj = _manager->getObject(data_) ;
obj->process(data_) ;
return true ;
}
There are two checks. The check if(_manager==NULL) can be placed outside the method since _manager is independent of the execution and should be set beforehand anyway.
No comments:
Post a Comment