Bug 129775 - Optimize collectionLast() and collectionTraverseBackward() in LiveNodeList
Summary: Optimize collectionLast() and collectionTraverseBackward() in LiveNodeList
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jinwoo Song
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-05 21:24 PST by Jinwoo Song
Modified: 2014-03-07 02:37 PST (History)
5 users (show)

See Also:


Attachments
Patch (5.55 KB, patch)
2014-03-05 22:09 PST, Jinwoo Song
no flags Details | Formatted Diff | Diff
Patch (5.53 KB, patch)
2014-03-07 01:36 PST, Jinwoo Song
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jinwoo Song 2014-03-05 21:24:17 PST
Backward traversing in LiveNodeList is left to be optimized similarly to forwarding case in r158698.
Comment 1 Jinwoo Song 2014-03-05 22:09:16 PST
Created attachment 225953 [details]
Patch
Comment 2 Andreas Kling 2014-03-07 00:13:28 PST
CC'ing Ryosuke who was working on this recently.
Comment 3 Ryosuke Niwa 2014-03-07 00:23:10 PST
Comment on attachment 225953 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=225953&action=review

> Source/WebCore/dom/LiveNodeList.cpp:112
> +    for (unsigned traversedCount = 0; traversedCount < count; ++traversedCount) {

We don't need traversedCount. Simply decrement count instead.
Comment 4 Jinwoo Song 2014-03-07 01:36:24 PST
Created attachment 226097 [details]
Patch

Applied Ryosuke's comment.
Comment 5 WebKit Commit Bot 2014-03-07 02:37:11 PST
Comment on attachment 226097 [details]
Patch

Clearing flags on attachment: 226097

Committed r165254: <http://trac.webkit.org/changeset/165254>
Comment 6 WebKit Commit Bot 2014-03-07 02:37:14 PST
All reviewed patches have been landed.  Closing bug.