File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
google/cloud/storage/internal/grpc Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 1313// limitations under the License.
1414
1515#include " google/cloud/storage/internal/grpc/buffer_read_object_data.h"
16+ #include " google/cloud/storage/internal/grpc/make_cord.h"
1617#include < algorithm>
1718
1819namespace google {
@@ -21,27 +22,26 @@ namespace storage_internal {
2122
2223std::size_t GrpcBufferReadObjectData::FillBuffer (char * buffer, std::size_t n) {
2324 std::size_t offset = 0 ;
24- for (auto v : spill_view_ .Chunks ()) {
25+ for (auto v : contents_ .Chunks ()) {
2526 if (offset == n) break ;
2627 auto const count = std::min (v.size (), n - offset);
2728 std::copy (v.data (), v.data () + count, buffer + offset);
2829 offset += count;
2930 }
30- spill_view_ = spill_view_. Subcord (offset, spill_view_. size () - offset);
31+ contents_. RemovePrefix ( offset);
3132 return offset;
3233}
3334
3435std::size_t GrpcBufferReadObjectData::HandleResponse (char * buffer,
3536 std::size_t n,
3637 std::string contents) {
37- return HandleResponse (buffer, n, absl::Cord (std::move (contents)));
38+ return HandleResponse (buffer, n, MakeCord (std::move (contents)));
3839}
3940
4041std::size_t GrpcBufferReadObjectData::HandleResponse (char * buffer,
4142 std::size_t n,
4243 absl::Cord contents) {
4344 contents_ = std::move (contents);
44- spill_view_ = contents_;
4545 return FillBuffer (buffer, n);
4646}
4747
Original file line number Diff line number Diff line change @@ -65,7 +65,6 @@ class GrpcBufferReadObjectData {
6565
6666 private:
6767 absl::Cord contents_;
68- absl::Cord spill_view_;
6968};
7069
7170GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
You can’t perform that action at this time.
0 commit comments