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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114612 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2010-09-22 23:20:04 +00:00
parent b6ec8cae3c
commit df046f078e

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;
}