Summary: | [MediaStream] Use iterator-based loops instead of index-based loops | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Roger Zanoni <rogerzanoni> | ||||||
Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue, eric.carlson, glenn, hta, jer.noble, nick.diego, tommyw | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Roger Zanoni
2013-11-29 15:40:24 PST
Created attachment 218080 [details]
Patch
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. Created attachment 218193 [details]
Patch
Comment on attachment 218193 [details] Patch Clearing flags on attachment: 218193 Committed r159958: <http://trac.webkit.org/changeset/159958> All reviewed patches have been landed. Closing bug. |