Change Cord iteration spelling under PLATFORM_GOOGLE.

PiperOrigin-RevId: 309329947
Change-Id: Ic2d717cff423a3a35071e86f93d8646bd9b27739
This commit is contained in:
A. Unique TensorFlower 2020-04-30 17:17:55 -07:00 committed by TensorFlower Gardener
parent 4ec68b65e3
commit dc71f88f8a
3 changed files with 3 additions and 9 deletions

View File

@ -265,9 +265,7 @@ uint32 Extend(uint32 crc, const char *buf, size_t size) {
#if defined(PLATFORM_GOOGLE)
uint32 Extend(uint32 crc, const absl::Cord &cord) {
absl::CordReader reader(cord);
absl::string_view fragment;
while (reader.ReadFragment(&fragment)) {
for (absl::string_view fragment : cord.Chunks()) {
crc = Extend(crc, fragment.data(), fragment.size());
}
return crc;

View File

@ -42,9 +42,7 @@ Status SnappyOutputBuffer::Append(StringPiece data) { return Write(data); }
#if defined(PLATFORM_GOOGLE)
Status SnappyOutputBuffer::Append(const absl::Cord& cord) {
absl::CordReader reader(cord);
absl::string_view fragment;
while (reader.ReadFragment(&fragment)) {
for (absl::string_view fragment : cord.Chunks()) {
TF_RETURN_IF_ERROR(Append(fragment));
}
return Status::OK();

View File

@ -192,9 +192,7 @@ Status ZlibOutputBuffer::Append(StringPiece data) {
#if defined(PLATFORM_GOOGLE)
Status ZlibOutputBuffer::Append(const absl::Cord& cord) {
absl::CordReader reader(cord);
absl::string_view fragment;
while (reader.ReadFragment(&fragment)) {
for (absl::string_view fragment : cord.Chunks()) {
TF_RETURN_IF_ERROR(Append(fragment));
}
return Status::OK();