Optimize calls to std::string::find() and friends for a single char.

The character literal overload is more efficient.

No-Presubmit: True
No-Try: True
Bug: None
Change-Id: Ice0b8478accd8a252ab81a0496d46c0f71db3db6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/197810
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32841}
This commit is contained in:
Mirko Bonadei
2020-12-16 07:29:02 +01:00
committed by Commit Bot
parent 0e7b3a9dad
commit 5686e3457e
5 changed files with 5 additions and 5 deletions

View File

@ -107,7 +107,7 @@ const int kPacketLossTimeUnitMs = 10;
// Common validator for file names.
static bool ValidateFilename(const std::string& value, bool is_output) {
if (!is_output) {
RTC_CHECK_NE(value.substr(value.find_last_of(".") + 1), "wav")
RTC_CHECK_NE(value.substr(value.find_last_of('.') + 1), "wav")
<< "WAV file input is not supported";
}
FILE* fid =