Commit 23840067 authored by avi's avatar avi Committed by Commit bot

Remove stl_util's deletion functions.

BUG=555865

Review-Url: https://codereview.chromium.org/2580793003
Cr-Commit-Position: refs/heads/master@{#439134}
parent 1a5cc3ae
......@@ -307,15 +307,6 @@ _BANNED_CPP_FUNCTIONS = (
True,
(),
),
(
r'STLDeleteValues', # http://crbug.com/555865
(
'This call is obsolete with C++ 11; create a map with owning',
'pointers instead (e.g. std::map<std::string, std::unique_ptr<x>> ).',
),
True,
(),
),
)
......
......@@ -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>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment