Skip to content

Commit

Permalink
Switching std::string::npos to WTF::kNotFound for string search
Browse files Browse the repository at this point in the history
I made a change earlier today not realizing that the strings used in
this class were WTF::Strings and not std::strings.  This is a follow-up
CL to address feedback that I should be using WTF::kNotFound instead of

std: :string::npos for the not found case.
Change-Id: I6f26ca2b9699e8a085a5368236cb54731480e9d7
Reviewed-on: https://chromium-review.googlesource.com/987536
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Joe Downing <joedow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547163}
  • Loading branch information
Joe Downing authored and Commit Bot committed Mar 30, 2018
1 parent 1d64b47 commit a7273b0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,11 @@ bool FingerprintMismatch(String old_sdp, String new_sdp) {
// Look for fingerprint being modified. Not allowed. Handle differences in
// line endings ('\r\n' vs, '\n' when looking for the end of the fingerprint).
size_t old_fingerprint_end = old_sdp.Find("\r\n", old_fingerprint_pos + 1);
if (old_fingerprint_end == std::string::npos) {
if (old_fingerprint_end == WTF::kNotFound) {
old_fingerprint_end = old_sdp.Find("\n", old_fingerprint_pos + 1);
}
size_t new_fingerprint_end = new_sdp.Find("\r\n", new_fingerprint_pos + 1);
if (new_fingerprint_end == std::string::npos) {
if (new_fingerprint_end == WTF::kNotFound) {
new_fingerprint_end = new_sdp.Find("\n", new_fingerprint_pos + 1);
}
return old_sdp.Substring(old_fingerprint_pos,
Expand Down

0 comments on commit a7273b0

Please sign in to comment.