Title: [148972] trunk/Source/WebKit/blackberry
Revision
148972
Author
[email protected]
Date
2013-04-23 10:08:57 -0700 (Tue, 23 Apr 2013)

Log Message

[BlackBerry] Simplify BackForwardListBlackBerry::clear
https://bugs.webkit.org/show_bug.cgi?id=115029

Patch by Xan Lopez <[email protected]> on 2013-04-23
Reviewed by Carlos Garcia Campos.

Simplify the implementation of the clear method. Instead of asking
the WebCore implementation to search each item and delete it, set
the capacity of the list to zero directly, which will do the same
thing but more efficiently.

No change in behavior, no new tests.

* WebCoreSupport/BackForwardListBlackBerry.cpp:
(WebCore::BackForwardListBlackBerry::clear):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/ChangeLog (148971 => 148972)


--- trunk/Source/WebKit/blackberry/ChangeLog	2013-04-23 16:20:02 UTC (rev 148971)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2013-04-23 17:08:57 UTC (rev 148972)
@@ -1,5 +1,22 @@
 2013-04-23  Xan Lopez  <[email protected]>
 
+        [BlackBerry] Simplify BackForwardListBlackBerry::clear
+        https://bugs.webkit.org/show_bug.cgi?id=115029
+
+        Reviewed by Carlos Garcia Campos.
+
+        Simplify the implementation of the clear method. Instead of asking
+        the WebCore implementation to search each item and delete it, set
+        the capacity of the list to zero directly, which will do the same
+        thing but more efficiently.
+
+        No change in behavior, no new tests.
+
+        * WebCoreSupport/BackForwardListBlackBerry.cpp:
+        (WebCore::BackForwardListBlackBerry::clear):
+
+2013-04-23  Xan Lopez  <[email protected]>
+
         [BlackBerry] Do not access BackForwardListImpl from DRT
         https://bugs.webkit.org/show_bug.cgi?id=115041
 

Modified: trunk/Source/WebKit/blackberry/WebCoreSupport/BackForwardListBlackBerry.cpp (148971 => 148972)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/BackForwardListBlackBerry.cpp	2013-04-23 16:20:02 UTC (rev 148971)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/BackForwardListBlackBerry.cpp	2013-04-23 17:08:57 UTC (rev 148972)
@@ -103,8 +103,9 @@
 
 void BackForwardListBlackBerry::clear()
 {
-    while (!m_impl->entries().isEmpty())
-        m_impl->removeItem(m_impl->entries().last().get());
+    int capacity = m_impl->capacity();
+    m_impl->setCapacity(0);
+    m_impl->setCapacity(capacity);
 }
 
 HistoryItemVector& BackForwardListBlackBerry::entries()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to