Bug 129513

Summary: Use range-based loops where possible in Heap methods
Product: WebKit Reporter: Mark Hahnenberg <mhahnenberg>
Component: JavaScriptCoreAssignee: Mark Hahnenberg <mhahnenberg>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, darin
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Mark Hahnenberg 2014-02-28 16:04:37 PST
The future is now!
Comment 1 Mark Hahnenberg 2014-03-04 21:54:20 PST
Created attachment 225854 [details]
Patch
Comment 2 Mark Lam 2014-03-04 22:03:57 PST
Comment on attachment 225854 [details]
Patch

r=me
Comment 3 WebKit Commit Bot 2014-03-05 08:40:41 PST
Comment on attachment 225854 [details]
Patch

Clearing flags on attachment: 225854

Committed r165109: <http://trac.webkit.org/changeset/165109>
Comment 4 WebKit Commit Bot 2014-03-05 08:40:43 PST
All reviewed patches have been landed.  Closing bug.
Comment 5 Darin Adler 2014-03-08 15:12:01 PST
Comment on attachment 225854 [details]
Patch

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

> Source/JavaScriptCore/heap/Heap.cpp:572
> +    for (auto pair : m_protectedValues)

This need to be auto& pair, otherwise it will copy the pair and work on the copy. Very bad!!!

> Source/JavaScriptCore/heap/Heap.cpp:585
> +    for (auto vector : m_tempSortingVectors) {
> +        for (auto valueStringPair : *vector) {

Same thing. Needs to be auto&.

> Source/JavaScriptCore/heap/Heap.h:454
> +        for (auto pair : m_protectedValues)

Same thing. Needs to be auto&.
Comment 6 Darin Adler 2014-03-08 15:13:12 PST
Looks like Anders fixed it in bug 129745.