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

Unified Diff: base/stl_util.h

Issue 2240083004: Remove stl_util's STLDeleteContainerPairPointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mattm Created 4 years, 4 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/safe_browsing/client_side_detection_service.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 b7e9cfc965bf9d572c8b420157a77729471da2c5..bb775f3e8563c98fd326417029df7934caccca99 100644
--- a/base/stl_util.h
+++ b/base/stl_util.h
@@ -48,24 +48,6 @@ void STLDeleteContainerPointers(ForwardIterator begin, ForwardIterator end) {
}
// For a range within a container of pairs, calls delete (non-array version) on
-// BOTH items in the pairs.
-// NOTE: Like STLDeleteContainerPointers, it is important that this deletes
-// behind the iterator because if both the key and value are deleted, the
-// container may call the hash function on the iterator when it is advanced,
-// which could result in the hash function trying to dereference a stale
-// pointer.
-template <class ForwardIterator>
-void STLDeleteContainerPairPointers(ForwardIterator begin,
- ForwardIterator end) {
- while (begin != end) {
- ForwardIterator temp = begin;
- ++begin;
- delete temp->first;
- delete temp->second;
- }
-}
-
-// For a range within a container of pairs, calls delete (non-array version) on
// the FIRST item in the pairs.
// NOTE: Like STLDeleteContainerPointers, deleting behind the iterator.
template <class ForwardIterator>
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/client_side_detection_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698