diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-04-28 16:00:45 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-04-28 16:00:45 +0000 |
commit | e5224b792dcb4d38827ebec74cedbefa3cf78018 (patch) | |
tree | 2ce94d7f0804ccb77d1fa9b2a1bca00eecdff1e2 /third_party/abseil-cpp/absl/strings/substitute.cc | |
parent | 88178ab82d402f04f48986d07f10b10aea9852a8 (diff) | |
parent | 7563023510bf04108a954596ea9393a4c11ac279 (diff) | |
download | webrtc-android13-frc-media-release.tar.gz |
Snap for 8512216 from 7563023510bf04108a954596ea9393a4c11ac279 to tm-frc-media-releaset_frc_med_330443030android13-frc-media-release
Change-Id: I08bed87f39763e4984489981fea9de450012cf88
Diffstat (limited to 'third_party/abseil-cpp/absl/strings/substitute.cc')
-rw-r--r-- | third_party/abseil-cpp/absl/strings/substitute.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/third_party/abseil-cpp/absl/strings/substitute.cc b/third_party/abseil-cpp/absl/strings/substitute.cc index 5b69a3ef00..8980b198c2 100644 --- a/third_party/abseil-cpp/absl/strings/substitute.cc +++ b/third_party/abseil-cpp/absl/strings/substitute.cc @@ -36,7 +36,7 @@ void SubstituteAndAppendArray(std::string* output, absl::string_view format, if (i + 1 >= format.size()) { #ifndef NDEBUG ABSL_RAW_LOG(FATAL, - "Invalid absl::Substitute() format std::string: \"%s\".", + "Invalid absl::Substitute() format string: \"%s\".", absl::CEscape(format).c_str()); #endif return; @@ -46,8 +46,8 @@ void SubstituteAndAppendArray(std::string* output, absl::string_view format, #ifndef NDEBUG ABSL_RAW_LOG( FATAL, - "Invalid absl::Substitute() format std::string: asked for \"$" - "%d\", but only %d args were given. Full format std::string was: " + "Invalid absl::Substitute() format string: asked for \"$" + "%d\", but only %d args were given. Full format string was: " "\"%s\".", index, static_cast<int>(num_args), absl::CEscape(format).c_str()); #endif @@ -61,7 +61,7 @@ void SubstituteAndAppendArray(std::string* output, absl::string_view format, } else { #ifndef NDEBUG ABSL_RAW_LOG(FATAL, - "Invalid absl::Substitute() format std::string: \"%s\".", + "Invalid absl::Substitute() format string: \"%s\".", absl::CEscape(format).c_str()); #endif return; @@ -73,9 +73,10 @@ void SubstituteAndAppendArray(std::string* output, absl::string_view format, if (size == 0) return; - // Build the std::string. + // Build the string. size_t original_size = output->size(); - strings_internal::STLStringResizeUninitialized(output, original_size + size); + strings_internal::STLStringResizeUninitializedAmortized(output, + original_size + size); char* target = &(*output)[original_size]; for (size_t i = 0; i < format.size(); i++) { if (format[i] == '$') { |