Bug 129775

Summary: Optimize collectionLast() and collectionTraverseBackward() in LiveNodeList
Product: WebKit Reporter: Jinwoo Song <jinwoo7.song>
Component: DOMAssignee: Jinwoo Song <jinwoo7.song>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, esprehn+autocc, kangil.han, kling, rniwa
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

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.