Skip to content

Commit 1399a03

Browse files
committed
fix(storage): resolve missing FormatCrc32c declaration and redundant move warnings
1 parent edad852 commit 1399a03

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

google/cloud/storage/internal/async/connection_impl.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ std::shared_ptr<storage::internal::HashFunction> CreateAppendableHashFunction(
134134
return std::make_shared<storage::internal::CompositeFunction>(
135135
std::move(crc32c), std::move(md5));
136136
}
137-
if (crc32c) return std::move(crc32c);
138-
if (md5) return std::move(md5);
137+
if (crc32c) return crc32c;
138+
if (md5) return md5;
139139
return storage::internal::CreateNullHashFunction();
140140
}
141141

google/cloud/storage/internal/async/writer_connection_impl.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
#include "google/cloud/storage/internal/async/handle_redirect_error.h"
1717
#include "google/cloud/storage/internal/async/partial_upload.h"
1818
#include "google/cloud/storage/internal/async/write_payload_impl.h"
19+
#include "google/cloud/storage/internal/base64.h"
1920
#include "google/cloud/storage/internal/grpc/ctype_cord_workaround.h"
2021
#include "google/cloud/storage/internal/grpc/object_metadata_parser.h"
2122
#include "google/cloud/storage/internal/hash_function_impl.h"
23+
#include "google/cloud/internal/big_endian.h"
2224
#include "google/cloud/internal/make_status.h"
2325

2426
namespace google {
@@ -27,6 +29,12 @@ namespace storage_internal {
2729
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
2830
namespace {
2931

32+
std::string FormatCrc32c(absl::optional<std::uint32_t> crc) {
33+
if (!crc) return {};
34+
return storage::internal::Base64Encode(
35+
google::cloud::internal::EncodeBigEndian(*crc));
36+
}
37+
3038
auto HandleFinishAfterError(std::string msg) {
3139
return [m = std::move(msg)](future<Status> f) {
3240
auto status = f.get();

0 commit comments

Comments
 (0)