| Index: base/stl_util.h
|
| diff --git a/base/stl_util.h b/base/stl_util.h
|
| index 3f7555dde5450052dfc9c930c3c444fe7a9a77f8..fef3eaa6430a32b2018922e49f5946cc2313b718 100644
|
| --- a/base/stl_util.h
|
| +++ b/base/stl_util.h
|
| @@ -54,29 +54,9 @@ inline char* string_as_array(std::string* str) {
|
| return str->empty() ? NULL : &*str->begin();
|
| }
|
|
|
| -// The following functions are useful for cleaning up STL containers whose
|
| +// The following function is useful for cleaning up STL containers whose
|
| // elements point to allocated memory.
|
|
|
| -// STLDeleteElements() deletes all the elements in an STL container and clears
|
| -// the container. This function is suitable for use with a vector, set,
|
| -// hash_set, or any other STL container which defines sensible begin(), end(),
|
| -// and clear() methods.
|
| -//
|
| -// If container is NULL, this function is a no-op.
|
| -template <class T>
|
| -void STLDeleteElements(T* container) {
|
| - if (!container)
|
| - return;
|
| -
|
| - for (auto it = container->begin(); it != container->end();) {
|
| - auto temp = it;
|
| - ++it;
|
| - delete *temp;
|
| - }
|
| -
|
| - container->clear();
|
| -}
|
| -
|
| // Given an STL container consisting of (key, value) pairs, STLDeleteValues
|
| // deletes all the "value" components and clears the container. Does nothing
|
| // in the case it's given a NULL pointer.
|
|
|