Skip to content

Commit 5494d3e

Browse files
GH-50236: Remove obsolete OpenSUSE 15.5 workarounds
1 parent 445851a commit 5494d3e

18 files changed

Lines changed: 24 additions & 50 deletions

cpp/src/arrow/array/concatenate.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,8 +636,7 @@ class ConcatenateImpl {
636636
}
637637
out_data += data->length * index_width;
638638
}
639-
// R build with openSUSE155 requires an explicit shared_ptr construction
640-
return std::shared_ptr<Buffer>(std::move(out));
639+
return out;
641640
}
642641

643642
Status Visit(const DictionaryType& d) {

cpp/src/arrow/array/util.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ class ArrayDataEndianSwapper {
125125
for (int64_t i = 0; i < length; i++) {
126126
out_data[i] = bit_util::ByteSwap(in_data[i]);
127127
}
128-
// R build with openSUSE155 requires an explicit shared_ptr construction
129-
return std::shared_ptr<Buffer>(std::move(out_buffer));
128+
return out_buffer;
130129
}
131130

132131
template <typename VALUE_TYPE>

cpp/src/arrow/buffer.cc

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ Result<std::shared_ptr<Buffer>> Buffer::CopySlice(const int64_t start,
4141

4242
ARROW_ASSIGN_OR_RAISE(auto new_buffer, AllocateResizableBuffer(nbytes, pool));
4343
std::memcpy(new_buffer->mutable_data(), data() + start, static_cast<size_t>(nbytes));
44-
// R build with openSUSE155 requires an explicit shared_ptr construction
45-
return std::shared_ptr<Buffer>(std::move(new_buffer));
44+
return new_buffer;
4645
}
4746

4847
Buffer::Buffer() : Buffer(memory_pool::internal::kZeroSizeArea, 0) {}
@@ -186,8 +185,7 @@ Result<std::shared_ptr<Buffer>> AllocateBitmap(int64_t length, MemoryPool* pool)
186185
if (buf->size() > 0) {
187186
buf->mutable_data()[buf->size() - 1] = 0;
188187
}
189-
// R build with openSUSE155 requires an explicit shared_ptr construction
190-
return std::shared_ptr<Buffer>(std::move(buf));
188+
return buf;
191189
}
192190

193191
Result<std::shared_ptr<Buffer>> AllocateEmptyBitmap(int64_t length, MemoryPool* pool) {
@@ -199,8 +197,7 @@ Result<std::shared_ptr<Buffer>> AllocateEmptyBitmap(int64_t length, int64_t alig
199197
ARROW_ASSIGN_OR_RAISE(auto buf,
200198
AllocateBuffer(bit_util::BytesForBits(length), alignment, pool));
201199
memset(buf->mutable_data(), 0, static_cast<size_t>(buf->size()));
202-
// R build with openSUSE155 requires an explicit shared_ptr construction
203-
return std::shared_ptr<Buffer>(std::move(buf));
200+
return buf;
204201
}
205202

206203
Result<std::shared_ptr<Buffer>> ConcatenateBuffers(
@@ -218,8 +215,7 @@ Result<std::shared_ptr<Buffer>> ConcatenateBuffers(
218215
out_data += buffer->size();
219216
}
220217
}
221-
// R build with openSUSE155 requires an explicit shared_ptr construction
222-
return std::shared_ptr<Buffer>(std::move(out));
218+
return out;
223219
}
224220

225221
} // namespace arrow

cpp/src/arrow/compute/function_internal.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,8 +706,7 @@ const FunctionOptionsType* GetFunctionOptionsType(const Properties&... propertie
706706
auto options = std::make_unique<Options>();
707707
RETURN_NOT_OK(
708708
FromStructScalarImpl<Options>(options.get(), scalar, properties_).status_);
709-
// R build with openSUSE155 requires an explicit unique_ptr construction
710-
return std::unique_ptr<FunctionOptions>(std::move(options));
709+
return options;
711710
}
712711
std::unique_ptr<FunctionOptions> Copy(const FunctionOptions& options) const override {
713712
auto out = std::make_unique<Options>();

cpp/src/arrow/compute/kernels/aggregate_pivot.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,7 @@ Result<std::unique_ptr<KernelState>> PivotInit(KernelContext* ctx,
159159
const auto& options = checked_cast<const PivotWiderOptions&>(*args.options);
160160
auto state = std::make_unique<PivotImpl>();
161161
RETURN_NOT_OK(state->Init(options, args.inputs, ctx->exec_context()));
162-
// GH-45718: This can be simplified once we drop the R openSUSE155 crossbow
163-
// job
164-
// R build with openSUSE155 requires an explicit shared_ptr construction
165-
return std::unique_ptr<KernelState>(std::move(state));
162+
return state;
166163
}
167164

168165
Result<TypeHolder> ResolveOutputType(KernelContext* ctx, const std::vector<TypeHolder>&) {

cpp/src/arrow/compute/kernels/hash_aggregate_internal.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ Result<std::unique_ptr<KernelState>> HashAggregateInit(KernelContext* ctx,
5555
const KernelInitArgs& args) {
5656
auto impl = std::make_unique<Impl>();
5757
RETURN_NOT_OK(impl->Init(ctx->exec_context(), args));
58-
// R build with openSUSE155 requires an explicit unique_ptr construction
59-
return std::unique_ptr<KernelState>(std::move(impl));
58+
return impl;
6059
}
6160

6261
inline Status HashAggregateResize(KernelContext* ctx, int64_t num_groups) {

cpp/src/arrow/compute/kernels/vector_hash.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,8 +533,7 @@ Result<std::unique_ptr<KernelState>> HashInit(KernelContext* ctx,
533533
auto result = std::make_unique<HashKernel>(args.inputs[0].GetSharedPtr(), args.options,
534534
ctx->memory_pool());
535535
RETURN_NOT_OK(result->Reset());
536-
// R build with openSUSE155 requires an explicit unique_ptr construction
537-
return std::unique_ptr<KernelState>(std::move(result));
536+
return result;
538537
}
539538

540539
template <typename Action>

cpp/src/arrow/dataset/file_parquet.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,7 @@ Result<std::shared_ptr<parquet::arrow::FileReader>> ParquetFileFormat::GetReader
512512
ARROW_ASSIGN_OR_RAISE(auto arrow_reader,
513513
parquet::arrow::FileReader::Make(options->pool, std::move(reader),
514514
std::move(arrow_properties)));
515-
// R build with openSUSE155 requires an explicit shared_ptr construction
516-
return std::shared_ptr<parquet::arrow::FileReader>(std::move(arrow_reader));
515+
return arrow_reader;
517516
}
518517

519518
Future<std::shared_ptr<parquet::arrow::FileReader>> ParquetFileFormat::GetReaderAsync(
@@ -555,8 +554,7 @@ Future<std::shared_ptr<parquet::arrow::FileReader>> ParquetFileFormat::GetReader
555554
reader)),
556555
arrow_properties));
557556

558-
// R build with openSUSE155 requires an explicit shared_ptr construction
559-
return std::shared_ptr<parquet::arrow::FileReader>(std::move(arrow_reader));
557+
return arrow_reader;
560558
},
561559
[path = source.path()](const Status& status)
562560
-> Result<std::shared_ptr<parquet::arrow::FileReader>> {

cpp/src/arrow/filesystem/s3fs.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,8 +1605,7 @@ class ObjectInputFile final : public io::RandomAccessFile {
16051605
DCHECK_LE(bytes_read, nbytes);
16061606
RETURN_NOT_OK(buf->Resize(bytes_read));
16071607
}
1608-
// R build with openSUSE155 requires an explicit shared_ptr construction
1609-
return std::shared_ptr<Buffer>(std::move(buf));
1608+
return buf;
16101609
}
16111610

16121611
Result<int64_t> Read(int64_t nbytes, void* out) override {

cpp/src/arrow/io/buffered.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,7 @@ class BufferedInputStream::Impl : public BufferedBase {
452452
RETURN_NOT_OK(buffer->Resize(bytes_read, false /* shrink_to_fit */));
453453
buffer->ZeroPadding();
454454
}
455-
// R build with openSUSE155 requires an explicit shared_ptr construction
456-
return std::shared_ptr<Buffer>(std::move(buffer));
455+
return buffer;
457456
}
458457

459458
// For providing access to the raw file handles

0 commit comments

Comments
 (0)