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
Thiago de Barros Lacerda
2014-03-18 09:58:48 PDT
Created attachment 227063 [details]
Patch
Comment on attachment 227063 [details] Patch Clearing flags on attachment: 227063 Committed r165834: <http://trac.webkit.org/changeset/165834> All reviewed patches have been landed. Closing bug. 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? (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 |