Skip to content

Commit f008e43

Browse files
committed
Fix remaining styling issues and long lines
1 parent 79e3883 commit f008e43

5 files changed

Lines changed: 21 additions & 20 deletions

File tree

google/cloud/storage/hashing_options.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ inline std::string ComputeMD5Hash(char const* payload) {
6262
}
6363

6464
/**
65-
6665
* Provide a pre-computed CRC32C checksum value.
6766
*
6867
* The application may be able to obtain a CRC32C checksum in some out-of-band
@@ -97,7 +96,6 @@ inline std::string ComputeCrc32cChecksum(char const* payload) {
9796
: absl::string_view{payload});
9897
}
9998

100-
10199
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
102100
} // namespace storage
103101
} // namespace cloud

google/cloud/storage/internal/checksum_helpers.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ inline HashDisabled GetDownloadChecksumSettings(Options const& options) {
3939
disable_md5 = (algo != ChecksumAlgorithm::kMD5);
4040
disable_crc32c = (algo != ChecksumAlgorithm::kCrc32c);
4141
}
42-
4342
return {disable_md5, disable_crc32c};
4443
}
4544

@@ -51,7 +50,6 @@ inline HashDisabled GetUploadChecksumSettings(Options const& options) {
5150
disable_md5 = (algo != ChecksumAlgorithm::kMD5);
5251
disable_crc32c = (algo != ChecksumAlgorithm::kCrc32c);
5352
}
54-
5553
return {disable_md5, disable_crc32c};
5654
}
5755

google/cloud/storage/internal/hash_function_impl_test.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -437,9 +437,14 @@ TEST(HashFunctionImplTest, CreateHashFunctionInsertObjectMedia) {
437437
auto const upload_cases = testing::UploadHashCases();
438438

439439
for (auto const& test : upload_cases) {
440-
bool disable_crc32c = (test.validation_algo == ChecksumAlgorithm::kNone || test.validation_algo == ChecksumAlgorithm::kMD5);
441-
bool disable_md5 = (test.validation_algo == ChecksumAlgorithm::kNone || test.validation_algo == ChecksumAlgorithm::kCrc32c);
442-
auto function = CreateHashFunction(test.crc32_value, disable_crc32c, test.md5_value, disable_md5);
440+
bool disable_crc32c =
441+
(test.validation_algo == ChecksumAlgorithm::kNone ||
442+
test.validation_algo == ChecksumAlgorithm::kMD5);
443+
bool disable_md5 =
444+
(test.validation_algo == ChecksumAlgorithm::kNone ||
445+
test.validation_algo == ChecksumAlgorithm::kCrc32c);
446+
auto function = CreateHashFunction(test.crc32_value, disable_crc32c,
447+
test.md5_value, disable_md5);
443448
ASSERT_STATUS_OK(function->Update(/*offset=*/0, kQuickFox));
444449
auto const actual = function->Finish();
445450
EXPECT_EQ(test.crc32c_expected, actual.crc32c);

google/cloud/storage/internal/hash_validator.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,17 @@ std::unique_ptr<HashValidator> CreateHashValidator(
5757
ReadObjectRangeRequest const& request) {
5858
if (request.RequiresRangeHeader()) return CreateNullHashValidator();
5959

60-
auto const settings = GetDownloadChecksumSettings(google::cloud::internal::CurrentOptions());
60+
auto const settings = GetDownloadChecksumSettings(
61+
google::cloud::internal::CurrentOptions());
6162
auto const disable_md5 = settings.md5;
6263
auto const disable_crc32c = settings.crc32c;
6364
return CreateHashValidator(disable_md5, disable_crc32c);
6465
}
6566

6667
std::unique_ptr<HashValidator> CreateHashValidator(
6768
ResumableUploadRequest const& request) {
68-
auto const settings = GetUploadChecksumSettings(google::cloud::internal::CurrentOptions());
69+
auto const settings = GetUploadChecksumSettings(
70+
google::cloud::internal::CurrentOptions());
6971
auto const disable_md5 = settings.md5;
7072
auto const disable_crc32c = settings.crc32c;
7173
return CreateHashValidator(disable_md5, disable_crc32c);

google/cloud/storage/parallel_upload.h

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -700,9 +700,9 @@ NonResumableParallelUploadState::Create(Client client,
700700
std::vector<ObjectWriteStream> streams;
701701

702702
auto upload_options = StaticTupleFilter<
703-
Among<ContentEncoding, ContentType,
704-
UploadChecksumValidationOption, EncryptionKey, KmsKeyName,
705-
PredefinedAcl, UserProject, WithObjectMetadata>::TPred>(
703+
Among<ContentEncoding, ContentType, UploadChecksumValidationOption,
704+
EncryptionKey, KmsKeyName, PredefinedAcl, UserProject,
705+
WithObjectMetadata>::TPred>(
706706
std::move(options));
707707
for (std::size_t i = 0; i < num_shards; ++i) {
708708
ResumableUploadRequest request(
@@ -806,9 +806,8 @@ StatusOr<ResumableParallelUploadState> ResumableParallelUploadState::CreateNew(
806806

807807
auto upload_options = std::tuple_cat(
808808
StaticTupleFilter<
809-
Among<ContentEncoding, ContentType,
810-
UploadChecksumValidationOption, EncryptionKey,
811-
KmsKeyName, PredefinedAcl, UserProject,
809+
Among<ContentEncoding, ContentType, UploadChecksumValidationOption,
810+
EncryptionKey, KmsKeyName, PredefinedAcl, UserProject,
812811
WithObjectMetadata>::TPred>(options),
813812
std::make_tuple(UseResumableUploadSession("")));
814813
for (std::size_t i = 0; i < num_shards; ++i) {
@@ -865,8 +864,7 @@ StatusOr<ResumableParallelUploadState> ResumableParallelUploadState::Resume(
865864
}
866865

867866
auto read_options = std::tuple_cat(
868-
StaticTupleFilter<Among<
869-
UploadChecksumValidationOption, EncryptionKey,
867+
StaticTupleFilter<Among<UploadChecksumValidationOption, EncryptionKey,
870868
Generation, UserProject>::TPred>(options),
871869
std::make_tuple(IfGenerationMatch(state_and_gen->second)));
872870

@@ -916,9 +914,9 @@ StatusOr<ResumableParallelUploadState> ResumableParallelUploadState::Resume(
916914
std::vector<ObjectWriteStream> streams;
917915

918916
auto upload_options = StaticTupleFilter<
919-
Among<ContentEncoding, ContentType,
920-
UploadChecksumValidationOption, EncryptionKey, KmsKeyName,
921-
PredefinedAcl, UserProject, WithObjectMetadata>::TPred>(
917+
Among<ContentEncoding, ContentType, UploadChecksumValidationOption,
918+
EncryptionKey, KmsKeyName, PredefinedAcl, UserProject,
919+
WithObjectMetadata>::TPred>(
922920
std::move(options));
923921
for (auto& stream_desc : persistent_state->streams) {
924922
ResumableUploadRequest request(bucket_name,

0 commit comments

Comments
 (0)