[prev in list] [next in list] [prev in thread] [next in thread] 

List:       webkit-unassigned
Subject:    [Webkit-unassigned] [Bug 125021] Changing some index based loops to iterator loops and using auto ke
From:       bugzilla-daemon () webkit ! org
Date:       2013-11-30 0:24:15
Message-ID: 20131130002242.EB3A815948F () lists ! macosforge ! org
[Download RAW message or body]

https://bugs.webkit.org/show_bug.cgi?id=125021


Sam Weinig <sam@webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #218080|review?, commit-queue?      |review-, commit-queue-
               Flag|                            |




--- Comment #2 from Sam Weinig <sam@webkit.org>  2013-11-29 16:22:39 PST ---
(From update of attachment 218080)
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.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
webkit-unassigned mailing list
webkit-unassigned@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-unassigned
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic