mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
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:
parent
b6ec8cae3c
commit
df046f078e
@ -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…
Reference in New Issue
Block a user