Bug 130402

Summary: Removing MediaStreamVector typedef
Product: WebKit Reporter: Thiago de Barros Lacerda <thiago.lacerda>
Component: WebCore Misc.Assignee: Thiago de Barros Lacerda <thiago.lacerda>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, eric.carlson, glenn, hta, jer.noble, philipj, sergio, tommyw
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 124288    
Attachments:
Description Flags
Patch none

Thiago de Barros Lacerda
Reported 2014-03-18 09:58:48 PDT
As did in r158480 for MediaStreamTrackVector and MediaStreamSourceVector. Those typedefs just compromises the code readability.
Attachments
Patch (4.34 KB, patch)
2014-03-18 10:06 PDT, Thiago de Barros Lacerda
no flags
Thiago de Barros Lacerda
Comment 1 2014-03-18 10:06:30 PDT
WebKit Commit Bot
Comment 2 2014-03-18 12:48:24 PDT
Comment on attachment 227063 [details] Patch Clearing flags on attachment: 227063 Committed r165834: <http://trac.webkit.org/changeset/165834>
WebKit Commit Bot
Comment 3 2014-03-18 12:48:28 PDT
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 4 2014-03-19 18:42:34 PDT
Comment on attachment 227063 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=227063&action=review > Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp:520 > - for (MediaStreamVector::iterator iter = m_localStreams.begin(); iter != m_localStreams.end(); ++iter) { > + for (auto iter = m_localStreams.begin(); iter != m_localStreams.end(); ++iter) { > if ((*iter)->id() == streamId) > return iter->get(); > } When you touch a loop like this one it’s best to make it a modern C++ loop too: for (auto& stream : m_localStreams) { if (stream->id() == streamId) return stream->get(); } Isn’t that better?
Thiago de Barros Lacerda
Comment 5 2014-03-20 06:42:34 PDT
(In reply to comment #4) > (From update of attachment 227063 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=227063&action=review > > > Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp:520 > > - for (MediaStreamVector::iterator iter = m_localStreams.begin(); iter != m_localStreams.end(); ++iter) { > > + for (auto iter = m_localStreams.begin(); iter != m_localStreams.end(); ++iter) { > > if ((*iter)->id() == streamId) > > return iter->get(); > > } > > When you touch a loop like this one it’s best to make it a modern C++ loop too: > > for (auto& stream : m_localStreams) { > if (stream->id() == streamId) > return stream->get(); > } > > Isn’t that better? Indeed Darin, I will do that next time. Thanks
Note You need to log in before you can comment on or make changes to this bug.