made the search straightforward

This commit is contained in:
Takeshi Abe 2012-04-13 02:16:31 +09:00
parent 7465f5e604
commit a9bad6b8f9

View File

@ -533,12 +533,14 @@ void BasicLibs::Insert( BasicLibInfo* LibInfo )
BasicLibInfo* BasicLibs::Remove( BasicLibInfo* LibInfo ) BasicLibInfo* BasicLibs::Remove( BasicLibInfo* LibInfo )
{ {
size_t i = GetPos( LibInfo ); vector< BasicLibInfo* >::iterator it, eit = aList.end();
if ( i < aList.size() ) for (it = aList.begin(); it != eit; ++it)
{ {
vector< BasicLibInfo* >::iterator it = aList.begin(); if (*it == LibInfo)
advance( it , i ); {
it = aList.erase( it ); aList.erase(it);
break;
}
} }
return LibInfo; return LibInfo;
} }