Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
kou authored Nov 21, 2023
1 parent ad0ed8f commit 7412b90
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cpp/src/arrow/filesystem/azurefs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ class ObjectAppendStream final : public io::OutputStream {
std::shared_ptr<Buffer> owned_buffer = nullptr) {
RETURN_NOT_OK(CheckClosed("append"));
auto append_data = reinterpret_cast<const uint8_t*>(data);
auto block_content = Azure::Core::IO::MemoryBodyStream(append_data, nbytes);
Azure::Core::IO::MemoryBodyStream block_content(append_data, nbytes);
if (block_content.Length() == 0) {
return Status::OK();
}
Expand All @@ -639,7 +639,7 @@ class ObjectAppendStream final : public io::OutputStream {
// New block ID must always be distinct from the existing block IDs. Otherwise we
// will accidentally replace the content of existing blocks, causing corruption.
// We will use monotonically increasing integers.
std::string new_block_id = std::to_string(n_block_ids);
auto new_block_id = std::to_string(n_block_ids);

// Pad to 5 digits, because Azure allows a maximum of 50,000 blocks.
const size_t target_number_of_digits = 5;
Expand Down
3 changes: 1 addition & 2 deletions cpp/src/arrow/filesystem/azurefs_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -686,8 +686,7 @@ TEST_F(AzuriteFileSystemTest, TestWriteMetadata) {

TEST_F(AzuriteFileSystemTest, OpenOutputStreamSmall) {
const auto path = PreexistingContainerPath() + "test-write-object";
std::shared_ptr<io::OutputStream> output;
ASSERT_OK_AND_ASSIGN(output, fs_->OpenOutputStream(path, {}));
ASSERT_OK_AND_ASSIGN(auto output, fs_->OpenOutputStream(path, {}));
const std::string_view expected(kLoremIpsum);
ASSERT_OK(output->Write(expected));
ASSERT_OK(output->Close());
Expand Down

0 comments on commit 7412b90

Please sign in to comment.