llvm.org GIT mirror llvm / 0bdc620
Implement the remove method for deleting entries from the SetVector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16283 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Spencer 15 years ago
1 changed file(s) with 11 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
1919 #include
2020 #include
2121 #include
22 #include
2223
2324 namespace llvm {
2425
107108 vector_.push_back(*Start);
108109 }
109110
111 /// @brief Remove an item from the set vector.
112 void remove(const value_type& X) {
113 if (0 < set_.erase(X)) {
114 iterator I = find(vector_.begin(),vector_.end(),X);
115 if (I != vector_.end())
116 vector_.erase(I);
117 }
118 }
119
120
110121 /// @returns 0 if the element is not in the SetVector, 1 if it is.
111122 /// @brief Count the number of elements of a given key in the SetVector.
112123 size_type count(const key_type &key) const {