Skip to content

Commit

Permalink
try to fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mapleFU committed Aug 24, 2023
1 parent f74b8d2 commit cbe761e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions cpp/src/arrow/io/memory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,13 @@ BufferReader::BufferReader(std::shared_ptr<Buffer> buffer)
is_open_(true) {}

BufferReader::BufferReader(const uint8_t* data, int64_t size)
: buffer_(nullptr), data_(data), size_(size), position_(0), is_open_(true) {}
: BufferReader(std::make_shared<Buffer>(data, size)) {}

BufferReader::BufferReader(const Buffer& buffer)
: BufferReader(buffer.data(), buffer.size()) {}
: BufferReader(std::make_shared<Buffer>(buffer.data(), buffer.size())) {}

BufferReader::BufferReader(std::string_view data)
: BufferReader(reinterpret_cast<const uint8_t*>(data.data()),
static_cast<int64_t>(data.size())) {}
: BufferReader(std::make_shared<Buffer>(data)) {}

std::unique_ptr<BufferReader> BufferReader::FromString(std::string data) {
return std::make_unique<BufferReader>(Buffer::FromString(std::move(data)));
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/arrow/io/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,17 @@ class ARROW_EXPORT BufferReader
public:
explicit BufferReader(std::shared_ptr<Buffer> buffer);
ARROW_DEPRECATED(
"Deprecated in 12.0.0. Use FromString or BufferReader(std::shared_ptr<Buffer> "
"Deprecated in 14.0.0. Use FromString or BufferReader(std::shared_ptr<Buffer> "
"buffer) instead.")
explicit BufferReader(const Buffer& buffer);
ARROW_DEPRECATED(
"Deprecated in 12.0.0. Use FromString or BufferReader(std::shared_ptr<Buffer> "
"Deprecated in 14.0.0. Use FromString or BufferReader(std::shared_ptr<Buffer> "
"buffer) instead.")
BufferReader(const uint8_t* data, int64_t size);

/// \brief Instantiate from std::string_view. Does not own data
ARROW_DEPRECATED(
"Deprecated in 12.0.0. Use FromString or BufferReader(std::shared_ptr<Buffer> "
"Deprecated in 14.0.0. Use FromString or BufferReader(std::shared_ptr<Buffer> "
"buffer) instead.")
explicit BufferReader(std::string_view data);

Expand Down

0 comments on commit cbe761e

Please sign in to comment.