[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/dlist.cpp server/dlist.h
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/dlist.cpp server/dlist.h |
Date: |
Wed, 17 Oct 2007 11:14:17 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/10/17 11:14:17
Modified files:
. : ChangeLog
server : dlist.cpp dlist.h
Log message:
* server/dlist.{cpp,h}: add isSorted private method
to slighly speed up invariant testing.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4621&r2=1.4622
http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.cpp?cvsroot=gnash&r1=1.95&r2=1.96
http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.h?cvsroot=gnash&r1=1.54&r2=1.55
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4621
retrieving revision 1.4622
diff -u -b -r1.4621 -r1.4622
--- ChangeLog 17 Oct 2007 05:41:35 -0000 1.4621
+++ ChangeLog 17 Oct 2007 11:14:16 -0000 1.4622
@@ -1,5 +1,7 @@
2007-10-17 Sandro Santilli <address@hidden>
+ * server/dlist.{cpp,h}: add isSorted private method
+ to slighly speed up invariant testing.
* server/edit_text_character.{cpp,h}: Add support for
the TextField.onChanged event.
Index: server/dlist.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/dlist.cpp,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -b -r1.95 -r1.96
--- server/dlist.cpp 4 Oct 2007 12:01:35 -0000 1.95
+++ server/dlist.cpp 17 Oct 2007 11:14:17 -0000 1.96
@@ -955,6 +955,24 @@
testInvariant();
}
+bool
+DisplayList::isSorted() const
+{
+ if ( _charsByDepth.empty() ) return true;
+
+ const_iterator i=_charsByDepth.begin();
+ int minDepth = (*i)->get_depth();
+ ++i;
+ for (const_iterator e=_charsByDepth.end(); i!=e; ++i)
+ {
+ int nextDepth = (*i)->get_depth();
+
+ if ( nextDepth < minDepth ) return false;
+ minDepth = nextDepth;
+ }
+ return true;
+}
+
} // namespace gnash
Index: server/dlist.h
===================================================================
RCS file: /sources/gnash/gnash/server/dlist.h,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -b -r1.54 -r1.55
--- server/dlist.h 4 Oct 2007 12:01:35 -0000 1.54
+++ server/dlist.h 17 Oct 2007 11:14:17 -0000 1.55
@@ -69,8 +69,7 @@
abort();
}
}
- sorted.sort();
- assert(*this == sorted); // check we didn't screw up ordering
+ assert(isSorted()); // check we didn't screw up ordering
#endif
}
@@ -416,6 +415,8 @@
container_type _charsByDepth;
+ /// Check that the list is sorted by depth
+ bool isSorted() const;
};
template <class V>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/dlist.cpp server/dlist.h,
Sandro Santilli <=