Change GetStreamBySsrc to not copy StreamParams.
This is something I stumbled upon while looking at string copying we do (in spades) and did a simple change to not be constantly copying things around needlessly. There's a lot more that can be done in these files of course so this is sort of a reminder for future code edits that it's possible to design interfaces/function in a way that's more performance aware and avoid forcing creation of copies, while still being very simple. Also, we can use lambdas now :)
BUG=
R=perkj@webrtc.org, pthatcher@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/41589004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8131 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/talk/media/base/fakemediaengine.h b/talk/media/base/fakemediaengine.h
index c5de323..391ec37 100644
--- a/talk/media/base/fakemediaengine.h
+++ b/talk/media/base/fakemediaengine.h
@@ -160,10 +160,10 @@
return receive_streams_;
}
bool HasRecvStream(uint32 ssrc) const {
- return GetStreamBySsrc(receive_streams_, ssrc, NULL);
+ return GetStreamBySsrc(receive_streams_, ssrc) != nullptr;
}
bool HasSendStream(uint32 ssrc) const {
- return GetStreamBySsrc(send_streams_, ssrc, NULL);
+ return GetStreamBySsrc(send_streams_, ssrc) != nullptr;
}
// TODO(perkj): This is to support legacy unit test that only check one
// sending stream.