From a9bad6b8f99dfb1640fbbff3f29036182f0103f6 Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Fri, 13 Apr 2012 02:16:31 +0900 Subject: [PATCH] made the search straightforward --- basic/source/basmgr/basmgr.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 5e909b2cebae..3de240f08bda 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -533,12 +533,14 @@ void BasicLibs::Insert( BasicLibInfo* LibInfo ) BasicLibInfo* BasicLibs::Remove( BasicLibInfo* LibInfo ) { - size_t i = GetPos( LibInfo ); - if ( i < aList.size() ) + vector< BasicLibInfo* >::iterator it, eit = aList.end(); + for (it = aList.begin(); it != eit; ++it) { - vector< BasicLibInfo* >::iterator it = aList.begin(); - advance( it , i ); - it = aList.erase( it ); + if (*it == LibInfo) + { + aList.erase(it); + break; + } } return LibInfo; }