[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/movie_root.cpp server/dl...
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] gnash ChangeLog server/movie_root.cpp server/dl... |
Date: |
Thu, 05 Jun 2008 14:39:03 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Benjamin Wolsey <bwy> 08/06/05 14:39:03
Modified files:
. : ChangeLog
server : movie_root.cpp dlist.cpp
Log message:
* server/dlist.cpp: use list::remove_if() instead of
std::remove_if()
on a list.
* server/movie_root.cpp: use list::remove_if() rather than
iterating
to remove listeners.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6829&r2=1.6830
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.cpp?cvsroot=gnash&r1=1.202&r2=1.203
http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.cpp?cvsroot=gnash&r1=1.126&r2=1.127
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6829
retrieving revision 1.6830
diff -u -b -r1.6829 -r1.6830
--- ChangeLog 5 Jun 2008 13:36:56 -0000 1.6829
+++ ChangeLog 5 Jun 2008 14:39:02 -0000 1.6830
@@ -1,3 +1,10 @@
+2008-06-05 Benjamin Wolsey <address@hidden>
+
+ * server/dlist.cpp: use list::remove_if() instead of std::remove_if()
+ on a list.
+ * server/movie_root.cpp: use list::remove_if() rather than iterating
+ to remove listeners.
+
2008-06-05 Sandro Santilli <address@hidden>
* libmedia/ffmpeg/VideoDecoderFfmpeg.cpp (init): print codec
Index: server/movie_root.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.cpp,v
retrieving revision 1.202
retrieving revision 1.203
diff -u -b -r1.202 -r1.203
--- server/movie_root.cpp 5 Jun 2008 10:08:33 -0000 1.202
+++ server/movie_root.cpp 5 Jun 2008 14:39:03 -0000 1.203
@@ -40,6 +40,7 @@
#include <map>
#include <typeinfo>
#include <cassert>
+#include <functional> // std::bind2nd, std::equal_to
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/bind.hpp>
@@ -1249,15 +1250,22 @@
ll.push_front(listener);
}
+
/* static private */
void movie_root::remove_listener(CharacterList& ll, character* listener)
{
assert(listener);
+
+#if 0
for(CharacterList::iterator iter = ll.begin(); iter != ll.end(); )
{
if(*iter == listener) iter = ll.erase(iter);
else ++iter;
}
+#else
+ // This should be faster.
+ ll.remove_if(std::bind2nd(std::equal_to<boost::intrusive_ptr<character>
>(), listener));
+#endif
}
void
Index: server/dlist.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/dlist.cpp,v
retrieving revision 1.126
retrieving revision 1.127
diff -u -b -r1.126 -r1.127
--- server/dlist.cpp 2 Jun 2008 12:19:26 -0000 1.126
+++ server/dlist.cpp 5 Jun 2008 14:39:03 -0000 1.127
@@ -1157,9 +1157,13 @@
{
testInvariant();
- // TODO: erase from begin() to beginNonRemoved()-1 ?
+#if 1
+ // This is a list, so list::remove_if is quicker and cleaner than
std::remove_if
+ _charsByDepth.remove_if(boost::bind(&character::isUnloaded, _1));
+#else
iterator last = std::remove_if(_charsByDepth.begin(), _charsByDepth.end(),
boost::bind(&character::isUnloaded, _1));
_charsByDepth.erase(last, _charsByDepth.end());
+#endif
testInvariant();
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/movie_root.cpp server/dl...,
Benjamin Wolsey <=