------------------------------------------------------------
revno: 9728
committer: Bastiaan Jacques <address@hidden>
branch nick: rtmp
timestamp: Thu 2008-11-13 05:46:27 +0100
message:
Simplify removal methods by calling std::map's erase(key).
modified:
libnet/cache.cpp
=== modified file 'libnet/cache.cpp'
--- a/libnet/cache.cpp 2008-11-13 02:11:59 +0000
+++ b/libnet/cache.cpp 2008-11-13 04:46:27 +0000
@@ -57,13 +57,7 @@
{
// GNASH_REPORT_FUNCTION;
boost::mutex::scoped_lock lock(cache_mutex);
- map<string, string>::iterator it;
- for (it = _pathnames.begin(); it != _pathnames.end(); it++) {
- if (it->first == name) {
- _pathnames.erase(it);
- break;
- }
- }
+ _pathnames.erase(name);
}
void
@@ -71,13 +65,7 @@
{
// GNASH_REPORT_FUNCTION;
boost::mutex::scoped_lock lock(cache_mutex);
- map<string, string>::iterator it;
- for (it = _responses.begin(); it != _responses.end(); it++) {
- if (it->first == name) {
- _responses.erase(it);
- break;
- }
- }
+ _responses.erase(name);
}
void
@@ -85,14 +73,7 @@
{
// GNASH_REPORT_FUNCTION;
boost::mutex::scoped_lock lock(cache_mutex);
- map<string, DiskStream *>::iterator it;
- for (it = _files.begin(); it != _files.end(); it++) {
-// DiskStream *ds = it->second;
- if (it->first == name) {
- _files.erase(it);
- break;
- }
- }
+ _files.erase(name);
}
void
_______________________________________________
Gnash-commit mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/gnash-commit