Bug 129513 - Use range-based loops where possible in Heap methods
Summary: Use range-based loops where possible in Heap methods
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Hahnenberg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-28 16:04 PST by Mark Hahnenberg
Modified: 2014-03-08 15:13 PST (History)
2 users (show)

See Also:


Attachments
Patch (6.29 KB, patch)
2014-03-04 21:54 PST, Mark Hahnenberg
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.