Index: base/memory/scoped_vector.h |
diff --git a/base/memory/scoped_vector.h b/base/memory/scoped_vector.h |
index ebc2617cfb2f456ad4e0f14c8272c21e2866a4b7..508c37bea32eb6256df948cce04bad2b3c4f22e4 100644 |
--- a/base/memory/scoped_vector.h |
+++ b/base/memory/scoped_vector.h |
@@ -88,8 +88,14 @@ class ScopedVector { |
// Resize, deleting elements in the disappearing range if we are shrinking. |
void resize(size_t new_size) { |
- if (v_.size() > new_size) |
- base::STLDeleteContainerPointers(v_.begin() + new_size, v_.end()); |
+ if (v_.size() > new_size) { |
+ auto it = v_.begin() + new_size; |
+ auto end = v_.end(); |
+ while (it != end) { |
+ delete *it; |
+ ++it; |
Nico
2016/09/08 17:32:00
how is this better than the old thing?
Avi (use Gerrit)
2016/09/13 14:36:13
I'm trying to remove STLDeleteContainerPointers, a
|
+ } |
+ } |
v_.resize(new_size); |
} |
@@ -124,7 +130,11 @@ class ScopedVector { |
} |
iterator erase(iterator first, iterator last) { |
- base::STLDeleteContainerPointers(first, last); |
+ auto it = first; |
+ while (it != last) { |
+ delete *it; |
+ ++it; |
+ } |
return v_.erase(first, last); |
} |