commit 7314cbc64443f0eff0dd7821b51c41da1723d326
parent a60437b4b24cf553ec43b66f09499fcfce4b48ca
Author: Tawah Peggy <tawahpeggy98@gmail.com>
Date: Fri, 21 Nov 2025 19:53:19 +0000
Bug 1855927 - Use starts_with() instead of find() r=webrtc-reviewers,ng
C++ 20 feature
Differential Revision: https://phabricator.services.mozilla.com/D192776
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dom/media/webrtc/sdp/SdpHelper.cpp b/dom/media/webrtc/sdp/SdpHelper.cpp
@@ -433,7 +433,7 @@ nsresult SdpHelper::GetMsids(const SdpMediaSection& msection,
auto& ssrcs = msection.GetAttributeList().GetSsrc().mSsrcs;
for (auto i = ssrcs.begin(); i != ssrcs.end(); ++i) {
- if (i->attribute.find("msid:") == 0) {
+ if (i->attribute.starts_with("msid:")) {
std::string streamId;
std::string trackId;
nsresult rv = ParseMsid(i->attribute, &streamId, &trackId);
@@ -497,7 +497,7 @@ std::string SdpHelper::GetCNAME(const SdpMediaSection& msection) const {
if (msection.GetAttributeList().HasAttribute(SdpAttribute::kSsrcAttribute)) {
auto& ssrcs = msection.GetAttributeList().GetSsrc().mSsrcs;
for (auto i = ssrcs.begin(); i != ssrcs.end(); ++i) {
- if (i->attribute.find("cname:") == 0) {
+ if (i->attribute.starts_with("cname:")) {
return i->attribute.substr(6);
}
}