mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-26 06:04:47 +00:00
Make SetVector's remove indicate whether it actually removed something.
llvm-svn: 114612
This commit is contained in:
parent
bfcaec30d6
commit
d299070514
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user