WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
150091
Avoid useless copies in range-loops that are using 'auto'
https://bugs.webkit.org/show_bug.cgi?id=150091
Summary
Avoid useless copies in range-loops that are using 'auto'
Chris Dumez
Reported
2015-10-13 10:45:14 PDT
Avoid useless copies in range-loops that are using 'auto'. Also use 'auto*' instead of 'auto' when range values are pointers for clarity.
Attachments
Patch
(58.09 KB, patch)
2015-10-13 10:52 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(57.75 KB, patch)
2015-10-13 11:43 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2015-10-13 10:52:56 PDT
Created
attachment 262992
[details]
Patch
Darin Adler
Comment 2
2015-10-13 11:35:43 PDT
Comment on
attachment 262992
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=262992&action=review
> Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:142 > - for (auto track : stream.tracks()) { > + for (auto& track : stream.tracks()) { > m_MediaStreamPrivate->addTrack(WTF::move(track));
This one changes semantics, not just efficiency. Moving from a reference is different from moving from a copy. Hope that’s OK. I didn’t have time just now to look at the tracks() function to make sure it’s harmless.
> Source/WebKit2/UIProcess/WebProcessProxy.cpp:482 > + for (auto& iter : m_pageURLRetainCountMap) {
The name iter is so lame.
Chris Dumez
Comment 3
2015-10-13 11:43:09 PDT
Created
attachment 263002
[details]
Patch
WebKit Commit Bot
Comment 4
2015-10-13 12:16:32 PDT
Comment on
attachment 263002
[details]
Patch Clearing flags on attachment: 263002 Committed
r191002
: <
http://trac.webkit.org/changeset/191002
>
WebKit Commit Bot
Comment 5
2015-10-13 12:16:38 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug