WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
125021
[MediaStream] Use iterator-based loops instead of index-based loops
https://bugs.webkit.org/show_bug.cgi?id=125021
Summary
[MediaStream] Use iterator-based loops instead of index-based loops
Roger Zanoni
Reported
2013-11-29 15:40:24 PST
Changing some index based loops to iterator loops and using auto keyword instead of default iterators
Attachments
Patch
(1.87 KB, patch)
2013-11-29 15:41 PST
,
Roger Zanoni
no flags
Details
Formatted Diff
Diff
Patch
(4.61 KB, patch)
2013-12-02 11:16 PST
,
Roger Zanoni
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Roger Zanoni
Comment 1
2013-11-29 15:41:40 PST
Created
attachment 218080
[details]
Patch
Sam Weinig
Comment 2
2013-11-29 16:22:39 PST
Comment on
attachment 218080
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=218080&action=review
A few notes: - This bug does not have a descriptive enough title. - The patch is missing a changelog.
> Source/WebCore/Modules/mediastream/MediaStream.cpp:140 > + for (auto iter = source.begin(); iter != source.end(); ++iter)
The normal pattern we use is: for (auto it = source.begin(), end = source.end(); it != end; ++it) ... This avoids resolving .end() multiple times.
> Source/WebCore/Modules/mediastream/MediaStream.cpp:-259 > + for (auto iter = m_audioTracks.begin(); iter != m_audioTracks.end(); ++iter) > + if (!(*iter)->ended()) > return; > - > - for (size_t i = 0; i < m_videoTracks.size(); ++i) > - if (!m_videoTracks[i]->ended()) > + for (auto iter = m_videoTracks.begin(); iter != m_videoTracks.end(); ++iter) > + if (!(*iter)->ended()) > return; > -
The two loops should have braces.
Roger Zanoni
Comment 3
2013-12-02 11:16:46 PST
Created
attachment 218193
[details]
Patch
WebKit Commit Bot
Comment 4
2013-12-02 13:38:31 PST
Comment on
attachment 218193
[details]
Patch Clearing flags on attachment: 218193 Committed
r159958
: <
http://trac.webkit.org/changeset/159958
>
WebKit Commit Bot
Comment 5
2013-12-02 13:38:34 PST
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