Make SetVector's remove indicate whether it actually removed something.

llvm-svn: 114612
This commit is contained in:
Dan Gohman 2010-09-22 23:20:04 +00:00
parent bfcaec30d6
commit d299070514

View File

@ -114,13 +114,15 @@ public:
}
/// @brief Remove an item from the set vector.
void remove(const value_type& X) {
bool remove(const value_type& X) {
if (set_.erase(X)) {
typename vector_type::iterator I =
std::find(vector_.begin(), vector_.end(), X);
assert(I != vector_.end() && "Corrupted SetVector instances!");
vector_.erase(I);
return true;
}
return false;
}