Skip to content

Commit

Permalink
Avoid unnecessary copying of AzurePath
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Newton committed Oct 18, 2023
1 parent 10c25e2 commit b9f1eaf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cpp/src/arrow/filesystem/azurefs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,10 @@ std::shared_ptr<const KeyValueMetadata> GetObjectMetadata(const ObjectResult& re
class ObjectInputFile final : public io::RandomAccessFile {
public:
ObjectInputFile(std::shared_ptr<Azure::Storage::Blobs::BlobClient> blob_client,
const io::IOContext& io_context, const AzurePath& path,
int64_t size = kNoSize)
const io::IOContext& io_context, AzurePath path, int64_t size = kNoSize)
: blob_client_(std::move(blob_client)),
io_context_(io_context),
path_(path),
path_(std::move(path)),
content_length_(size) {}

Status Init() {
Expand Down Expand Up @@ -342,7 +341,8 @@ class AzureFileSystem::Impl {
service_client_->GetBlobContainerClient(path.container)
.GetBlobClient(path.path_to_file));

auto ptr = std::make_shared<ObjectInputFile>(blob_client, fs->io_context(), path);
auto ptr =
std::make_shared<ObjectInputFile>(blob_client, fs->io_context(), std::move(path));
RETURN_NOT_OK(ptr->Init());
return ptr;
}
Expand All @@ -362,8 +362,8 @@ class AzureFileSystem::Impl {
service_client_->GetBlobContainerClient(path.container)
.GetBlobClient(path.path_to_file));

auto ptr = std::make_shared<ObjectInputFile>(blob_client, fs->io_context(), path,
info.size());
auto ptr = std::make_shared<ObjectInputFile>(blob_client, fs->io_context(),
std::move(path), info.size());
RETURN_NOT_OK(ptr->Init());
return ptr;
}
Expand Down

0 comments on commit b9f1eaf

Please sign in to comment.