gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-commit] /srv/bzr/gnash/rtmp r9728: Simplify removal methods b


From: Markus Gothe
Subject: Re: [Gnash-commit] /srv/bzr/gnash/rtmp r9728: Simplify removal methods by calling std::map's erase(key).
Date: Thu, 13 Nov 2008 11:22:46 +0100

Nice catch :)

//Markus

On 13 Nov 2008, at 05:46, Bastiaan Jacques wrote:

------------------------------------------------------------
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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]