Make the iterator form of erase return void, since it always succeeds,
authorDan Gohman <gohman@apple.com>
Wed, 1 Sep 2010 14:00:35 +0000 (14:00 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 1 Sep 2010 14:00:35 +0000 (14:00 +0000)
and since this is what std::map and std::set do.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112701 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/DenseMap.h
include/llvm/ADT/DenseSet.h
include/llvm/ADT/ValueMap.h

index c53e255e1c7cf0ad59be70c2271ccb3ed8eb630b..06a1575da4d0f124d5f136c4e362f06791ad087f 100644 (file)
@@ -185,13 +185,12 @@ public:
     ++NumTombstones;
     return true;
   }
-  bool erase(iterator I) {
+  void erase(iterator I) {
     BucketT *TheBucket = &*I;
     TheBucket->second.~ValueT();
     TheBucket->first = getTombstoneKey();
     --NumEntries;
     ++NumTombstones;
-    return true;
   }
 
   void swap(DenseMap& RHS) {
index 765105bbf518c1eedbad8a4ceccd333fbf28480b..00bcf64a2fc7c246514b33753f05a308fb363419 100644 (file)
@@ -106,8 +106,8 @@ public:
   const_iterator end() const { return ConstIterator(TheMap.end()); }
 
   iterator find(const ValueT &V) { return Iterator(TheMap.find(V)); }
-  bool erase(Iterator I) { return TheMap.erase(I.I); }
-  bool erase(ConstIterator CI) { return TheMap.erase(CI.I); }
+  void erase(Iterator I) { return TheMap.erase(I.I); }
+  void erase(ConstIterator CI) { return TheMap.erase(CI.I); }
 
   std::pair<iterator, bool> insert(const ValueT &V) {
     return TheMap.insert(std::make_pair(V, 0));
index af041fe5216f8137e385fb1dcfece497ce5d0321..ded17fc32223b76f18d80ba473f32fd6f2d1836a 100644 (file)
@@ -149,7 +149,7 @@ public:
   bool erase(const KeyT &Val) {
     return Map.erase(Wrap(Val));
   }
-  bool erase(iterator I) {
+  void erase(iterator I) {
     return Map.erase(I.base());
   }