Browse Source

[master] Merge branch 'master' of ssh://bind10.isc.org/var/bind10/git/bind10

JINMEI Tatuya 14 years ago
parent
commit
4903de33e8
1 changed files with 3 additions and 5 deletions
  1. 3 5
      src/lib/config/tests/fake_session.cc

+ 3 - 5
src/lib/config/tests/fake_session.cc

@@ -52,16 +52,14 @@ listContains(ConstElementPtr list, ConstElementPtr el) {
 
 
 void
 void
 listRemove(ElementPtr list, ConstElementPtr el) {
 listRemove(ElementPtr list, ConstElementPtr el) {
-    int i = -1;
+    int i = 0;
     BOOST_FOREACH(ConstElementPtr s_el, list->listValue()) {
     BOOST_FOREACH(ConstElementPtr s_el, list->listValue()) {
         if (*el == *s_el) {
         if (*el == *s_el) {
-            i = 0;
+            list->remove(i);
+            return;
         }
         }
         i++;
         i++;
     }
     }
-    if (i >= 0) {
-        list->remove(i);
-    }
 }
 }
 // endwant
 // endwant