[webkit-reviews] review denied: [Bug 125021] Changing some index based loops to iterator loops and using auto keyword instead of default iterators : [Attachment 218080] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 29 16:24:14 PST 2013


Sam Weinig <sam at webkit.org> has denied Roger Zanoni <rogerzanoni at gmail.com>'s
request for review:
Bug 125021: Changing some index based loops to iterator loops and using auto
keyword instead of default iterators
https://bugs.webkit.org/show_bug.cgi?id=125021

Attachment 218080: Patch
https://bugs.webkit.org/attachment.cgi?id=218080&action=review

------- Additional Comments from Sam Weinig <sam at webkit.org>
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.


More information about the webkit-reviews mailing list