diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2012-04-13 02:16:31 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2012-04-13 02:18:05 +0900 |
commit | a9bad6b8f99dfb1640fbbff3f29036182f0103f6 (patch) | |
tree | 38bc7a16aae6dbbd7a63f8f6fe2bc984f3e31cba /basic | |
parent | 7465f5e604ee449006a243f1d55cb0882bb58ac1 (diff) |
made the search straightforward
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/basmgr/basmgr.cxx | 12 |
1 files 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; } |