Eliminate a temporary std::string in ParsedFailed helper.
Bug: None Change-Id: If3435b5e9da9d2049c9b82b8b68e54d1ecc69003 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/233440 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Tommi <tommi@webrtc.org> Commit-Queue: Tommi <tommi@webrtc.org> Cr-Commit-Position: refs/heads/main@{#35125}
This commit is contained in:
parent
82ccdd36aa
commit
a654e07d11
@ -415,7 +415,9 @@ static bool ParseFailed(absl::string_view message,
|
||||
RTC_LOG(LS_ERROR) << "Failed to parse: \"" << first_line
|
||||
<< "\". Reason: " << description;
|
||||
if (error) {
|
||||
error->line = std::string(first_line);
|
||||
// TODO(bugs.webrtc.org/13220): In C++17, we can use plain assignment, with
|
||||
// a string_view on the right hand side.
|
||||
error->line.assign(first_line.data(), first_line.size());
|
||||
error->description = std::move(description);
|
||||
}
|
||||
return false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user