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

Unified Diff: base/stl_util.h

Issue 1020673002: Make STLDeleteValues delete behind the iterator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | 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 3602df0377ade5e461c73aad16f672743050b98d..89a53b070ef515cf81d584098e7aace8ed2ba201 100644
--- a/base/stl_util.h
+++ b/base/stl_util.h
@@ -148,8 +148,7 @@ template <class T>
void STLDeleteValues(T* container) {
if (!container)
return;
- for (typename T::iterator i(container->begin()); i != container->end(); ++i)
- delete i->second;
+ STLDeleteContainerPairSecondPointers(container->begin(), container->end());
container->clear();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698