- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Descriptors/MoleculeDescriptor.cpp
r51be2a r8cce2b 74 74 75 75 molecule* MoleculeDescriptor_impl::find() { 76 World::MoleculeSet molecules = getMolecules();76 World::MoleculeSet &molecules = getMolecules(); 77 77 molecules_iter_t res = find_if(molecules.begin_internal(),molecules.end_internal(),boost::bind(&MoleculeDescriptor_impl::predicate,this,_1)); 78 78 return (res!=molecules.end_internal())?((*res).second):0; … … 81 81 vector<molecule*> MoleculeDescriptor_impl::findAll() { 82 82 vector<molecule*> res; 83 World::MoleculeSet molecules = getMolecules(); 84 molecules_iter_t iter; 85 for(iter=molecules.begin_internal();iter!=molecules.end_internal();++iter) { 86 if(predicate(*iter)){ 87 res.push_back((*iter).second); 88 } 83 World::MoleculeSet &molecules = getMolecules(); 84 for_each(molecules.begin_internal(), 85 molecules.end_internal(), 86 boost::bind(&MoleculeDescriptor_impl::checkAndAdd, 87 this,&res,_1)); 88 return res; 89 } 90 91 void MoleculeDescriptor_impl::checkAndAdd(std::vector<molecule*> *v,std::pair<moleculeId_t,molecule*> p){ 92 if(predicate(p)){ 93 v->push_back(p.second); 89 94 } 90 return res;91 95 } 92 96
Note:
See TracChangeset
for help on using the changeset viewer.