[llvm-commits] [llvm] r114612 - /llvm/trunk/include/llvm/ADT/SetVector.h
Dan Gohman
gohman at apple.com
Wed Sep 22 16:20:04 PDT 2010
Author: djg
Date: Wed Sep 22 18:20:04 2010
New Revision: 114612
URL: http://llvm.org/viewvc/llvm-project?rev=114612&view=rev
Log:
Make SetVector's remove indicate whether it actually removed something.
Modified:
llvm/trunk/include/llvm/ADT/SetVector.h
Modified: llvm/trunk/include/llvm/ADT/SetVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SetVector.h?rev=114612&r1=114611&r2=114612&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/SetVector.h (original)
+++ llvm/trunk/include/llvm/ADT/SetVector.h Wed Sep 22 18:20:04 2010
@@ -114,13 +114,15 @@
}
/// @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;
}
More information about the llvm-commits
mailing list