Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2790)

Unified Diff: base/stl_util.h

Issue 2580793003: Remove stl_util's deletion functions. (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « PRESUBMIT.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/stl_util.h
diff --git a/base/stl_util.h b/base/stl_util.h
index fef3eaa6430a32b2018922e49f5946cc2313b718..016bb156450692415d9814f6a011446cf68ca591 100644
--- a/base/stl_util.h
+++ b/base/stl_util.h
@@ -54,26 +54,6 @@ inline char* string_as_array(std::string* str) {
return str->empty() ? NULL : &*str->begin();
}
-// The following function is useful for cleaning up STL containers whose
-// elements point to allocated memory.
-
-// 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.
-template <class T>
-void STLDeleteValues(T* container) {
- if (!container)
- return;
-
- for (auto it = container->begin(); it != container->end();) {
- auto temp = it;
- ++it;
- delete temp->second;
- }
-
- container->clear();
-}
-
// Test to see if a set, map, hash_set or hash_map contains a particular key.
// Returns true if the key is in the collection.
template <typename Collection, typename Key>
« no previous file with comments | « PRESUBMIT.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698