From 2d490c5f4ed96d5bbc1cd2e00ae4278621633cb4 Mon Sep 17 00:00:00 2001
From: Marco Biasini <marco.biasini@unibas.ch>
Date: Mon, 27 May 2013 15:23:25 +0200
Subject: [PATCH] start search for alternative names from beginning

---
 modules/conop/src/compound.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/conop/src/compound.cc b/modules/conop/src/compound.cc
index dc6ff57c8..6e496ad10 100644
--- a/modules/conop/src/compound.cc
+++ b/modules/conop/src/compound.cc
@@ -22,15 +22,15 @@ namespace ost { namespace conop {
 
 
 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
   // alternative names. There are some files where alternative atom names are 
   // 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)
       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)
       return std::distance(atom_specs_.begin(), i);
   }
-- 
GitLab