Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/utf8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class CordReader final {
}
if (n <= buffer_.size() - index_) {
// Enough data remaining in temporary buffer.
return absl::string_view(buffer_.data() + index_, n);
return absl::string_view(buffer_).substr(index_, n);
}
// We do not have enough data. See if we can fit it without allocating by
// shifting data back to the beginning of the buffer.
Expand All @@ -159,7 +159,7 @@ class CordReader final {
size_t to_copy = n - (buffer_.size() - index_);
absl::CopyCordToString(input_.Subcord(0, to_copy), &buffer_);
input_.RemovePrefix(to_copy);
return absl::string_view(buffer_.data() + index_, n);
return absl::string_view(buffer_).substr(index_, n);
}

char Read() {
Expand Down
Loading