Skip to content
Snippets Groups Projects
Commit 2d490c5f authored by Marco Biasini's avatar Marco Biasini
Browse files

start search for alternative names from beginning

parent fb65d50e
No related branches found
No related tags found
No related merge requests found
...@@ -22,15 +22,15 @@ namespace ost { namespace conop { ...@@ -22,15 +22,15 @@ namespace ost { namespace conop {
int Compound::GetAtomSpecIndex(const String& name) const { int Compound::GetAtomSpecIndex(const String& name) const {
AtomSpecList::const_iterator i=atom_specs_.begin(); AtomSpecList::const_iterator i;
// BZDNG-261: first search all primary atom names before falling back to // BZDNG-261: first search all primary atom names before falling back to
// alternative names. There are some files where alternative atom names are // alternative names. There are some files where alternative atom names are
// used as primary names for other atoms // used as primary names for other atoms
for (; i!=atom_specs_.end(); ++i) { for (i=atom_specs_.begin(); i!=atom_specs_.end(); ++i) {
if ((*i).name==name) if ((*i).name==name)
return std::distance(atom_specs_.begin(), i); return std::distance(atom_specs_.begin(), i);
} }
for (; i!=atom_specs_.end(); ++i) { for (i=atom_specs_.begin(); i!=atom_specs_.end(); ++i) {
if ((*i).alt_name==name) if ((*i).alt_name==name)
return std::distance(atom_specs_.begin(), i); return std::distance(atom_specs_.begin(), i);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment