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

Unified Diff: base/stl_util.h

Issue 2318303002: Remove stl_util's STLDeleteContainerPairSecondPointers. (Closed)
Patch Set: fix Created 4 years, 3 months 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 | « no previous file | chrome/browser/app_controller_mac.h » ('j') | 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 b8683377bb7872c711c4bc5bef21a19db87bcf29..b762b9fe0c15b143054420f9ffc6ea03847322a5 100644
--- a/base/stl_util.h
+++ b/base/stl_util.h
@@ -110,7 +110,14 @@ template <class T>
void STLDeleteValues(T* container) {
if (!container)
return;
- STLDeleteContainerPairSecondPointers(container->begin(), container->end());
+
+ auto it = container->begin();
+ while (it != container->end()) {
+ auto temp = it;
+ ++it;
+ delete temp->second;
+ }
+
container->clear();
}
« no previous file with comments | « no previous file | chrome/browser/app_controller_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698