merge(3p/absl): subtree merge of Abseil up to e19260f
... notably, this includes Abseil's own StatusOr type, which conflicted with our implementation (that was taken from TensorFlow). Change-Id: Ie7d6764b64055caaeb8dc7b6b9d066291e6b538f
This commit is contained in:
parent
cc27324d02
commit
082c006c04
854 changed files with 11260 additions and 5296 deletions
|
|
@ -141,12 +141,12 @@ namespace strings_internal {
|
|||
std::string CatPieces(std::initializer_list<absl::string_view> pieces) {
|
||||
std::string result;
|
||||
size_t total_size = 0;
|
||||
for (const absl::string_view piece : pieces) total_size += piece.size();
|
||||
for (const absl::string_view& piece : pieces) total_size += piece.size();
|
||||
strings_internal::STLStringResizeUninitialized(&result, total_size);
|
||||
|
||||
char* const begin = &result[0];
|
||||
char* out = begin;
|
||||
for (const absl::string_view piece : pieces) {
|
||||
for (const absl::string_view& piece : pieces) {
|
||||
const size_t this_size = piece.size();
|
||||
if (this_size != 0) {
|
||||
memcpy(out, piece.data(), this_size);
|
||||
|
|
@ -170,7 +170,7 @@ void AppendPieces(std::string* dest,
|
|||
std::initializer_list<absl::string_view> pieces) {
|
||||
size_t old_size = dest->size();
|
||||
size_t total_size = old_size;
|
||||
for (const absl::string_view piece : pieces) {
|
||||
for (const absl::string_view& piece : pieces) {
|
||||
ASSERT_NO_OVERLAP(*dest, piece);
|
||||
total_size += piece.size();
|
||||
}
|
||||
|
|
@ -178,7 +178,7 @@ void AppendPieces(std::string* dest,
|
|||
|
||||
char* const begin = &(*dest)[0];
|
||||
char* out = begin + old_size;
|
||||
for (const absl::string_view piece : pieces) {
|
||||
for (const absl::string_view& piece : pieces) {
|
||||
const size_t this_size = piece.size();
|
||||
if (this_size != 0) {
|
||||
memcpy(out, piece.data(), this_size);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue