Bug 136000 - Use modern for loop instead of iterators in SharedBufferCF.cpp
Summary: Use modern for loop instead of iterators in SharedBufferCF.cpp
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Pratik Solanki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-15 16:01 PDT by Pratik Solanki
Modified: 2014-08-18 16:23 PDT (History)
2 users (show)

See Also:


Attachments
Patch (2.64 KB, patch)
2014-08-15 16:02 PDT, Pratik Solanki
no flags Details | Formatted Diff | Diff
Patch (2.64 KB, patch)
2014-08-15 16:07 PDT, Pratik Solanki
no flags Details | Formatted Diff | Diff
Patch (3.09 KB, patch)
2014-08-18 12:09 PDT, Pratik Solanki
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pratik Solanki 2014-08-15 16:01:01 PDT
SharedBufferCF.cpp could use some for loop updates.
Comment 1 Pratik Solanki 2014-08-15 16:02:32 PDT
Created attachment 236685 [details]
Patch
Comment 2 WebKit Commit Bot 2014-08-15 16:05:06 PDT
Attachment 236685 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/cf/SharedBufferCF.cpp:160:  Missing space before ( in for(  [whitespace/parens] [5]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Pratik Solanki 2014-08-15 16:07:59 PDT
Created attachment 236687 [details]
Patch
Comment 4 Alexey Proskuryakov 2014-08-15 21:02:45 PDT
Comment on attachment 236687 [details]
Patch

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

> Source/WebCore/platform/cf/SharedBufferCF.cpp:157
> +    for (auto cfData : m_dataArray) {

This makes the code slightly slower, as it makes a new RetainPtr which churns refcount.
Comment 5 Andreas Kling 2014-08-15 21:08:49 PDT
Comment on attachment 236687 [details]
Patch

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

>> Source/WebCore/platform/cf/SharedBufferCF.cpp:157
>> +    for (auto cfData : m_dataArray) {
> 
> This makes the code slightly slower, as it makes a new RetainPtr which churns refcount.

Using auto& would avoid that.
Comment 6 Pratik Solanki 2014-08-18 12:09:00 PDT
Created attachment 236773 [details]
Patch
Comment 7 Pratik Solanki 2014-08-18 16:23:20 PDT
Committed r172735: <http://trac.webkit.org/changeset/172735>