From 2a0c7d1e56dfff663c1fbcaaf39b4e00140a0121 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Sun, 17 Dec 2006 19:04:13 +0000 Subject: [PATCH] Bugfix en CIndiceMagico::remove(string). --- trunk/src/indicemagico.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/trunk/src/indicemagico.h b/trunk/src/indicemagico.h index a23c975..01dae6d 100644 --- a/trunk/src/indicemagico.h +++ b/trunk/src/indicemagico.h @@ -10,6 +10,7 @@ #include #include #include +#include // FIXME template @@ -40,7 +41,9 @@ public: void add(CIndiceMagico& indice) { for (unsigned i = 0; i < indice.m_nombres.size(); ++i) + { add(indice.m_nombres[i], indice.m_datos[i]) ; + } } @@ -91,14 +94,12 @@ public: void remove(const std::string& nombre) { - bool exito = false ; - unsigned i; - - for (i = 0; !exito && i < m_nombres.size(); ++i) - exito = m_nombres[i]==nombre; - - if (exito) - remove(i); + for (unsigned i = 0; i < m_nombres.size(); ++i) + if (m_nombres[i]==nombre) + { + remove(i); + return; + } } -- 2.43.0