kou commented on code in PR #14216:
URL: https://github.com/apache/arrow/pull/14216#discussion_r978345918
##########
cpp/src/arrow/adapters/orc/adapter.cc:
##########
@@ -530,7 +530,7 @@ ORCFileReader::~ORCFileReader() {}
Result<std::unique_ptr<ORCFileReader>> ORCFileReader::Open(
const std::shared_ptr<io::RandomAccessFile>& file, MemoryPool* pool) {
- auto result = std::unique_ptr<ORCFileReader>(new ORCFileReader());
+ auto result = std::unique_ptr<ORCFileReader>(new ORCFileReader);
Review Comment:
Can we use `make_unique` here?
##########
cpp/src/arrow/util/future_test.cc:
##########
@@ -529,8 +529,7 @@ TEST(FutureStressTest, DeleteAfterWait) {
constexpr int kNumTasks = 100;
for (int i = 0; i < kNumTasks; i++) {
{
- std::unique_ptr<Future<>> future =
- std::make_unique<Future<>>(Future<>::Make());
+ std::unique_ptr<Future<>> future =
std::make_unique<Future<>>(Future<>::Make());
Review Comment:
Can we use `auto` here?
##########
cpp/src/arrow/flight/test_definitions.cc:
##########
@@ -854,8 +854,8 @@ Status AppMetadataTestServer::DoGet(const
ServerCallContext& context,
RETURN_NOT_OK(ExampleIntBatches(&batches));
}
ARROW_ASSIGN_OR_RAISE(auto batch_reader, RecordBatchReader::Make(batches));
- *data_stream = std::unique_ptr<FlightDataStream>(new NumberingStream(
- std::unique_ptr<FlightDataStream>(new RecordBatchStream(batch_reader))));
+ *data_stream = std::make_unique<FlightDataStream>(
+ NumberingStream(std::make_unique<RecordBatchStream>(batch_reader)));
Review Comment:
Can we use
`std::make_unique<NumberingStream>(std::make_unique<RecordBatchStream>(batch_reader))`
here?
##########
cpp/src/arrow/util/async_util_test.cc:
##########
@@ -437,8 +437,8 @@ TEST(AsyncTaskScheduler, Priority) {
constexpr int kNumConcurrentTasks = 8;
std::unique_ptr<AsyncTaskScheduler::Throttle> throttle =
AsyncTaskScheduler::MakeThrottle(kNumConcurrentTasks);
- std::unique_ptr<AsyncTaskScheduler> task_group = AsyncTaskScheduler::Make(
- throttle.get(), std::make_unique<PriorityQueue>());
+ std::unique_ptr<AsyncTaskScheduler> task_group =
Review Comment:
Can we use `auto` here?
##########
cpp/src/arrow/flight/integration_tests/test_integration_server.cc:
##########
@@ -119,8 +119,8 @@ class FlightIntegrationTestServer : public FlightServerBase
{
auto flight = data->second;
*data_stream = std::unique_ptr<FlightDataStream>(
- new NumberingStream(std::unique_ptr<FlightDataStream>(new
RecordBatchStream(
- std::shared_ptr<RecordBatchReader>(new
RecordBatchListReader(flight))))));
+ new NumberingStream(std::unique_ptr<FlightDataStream>(
+ new
RecordBatchStream(std::make_shared<RecordBatchListReader>(flight)))));
Review Comment:
Can we use `make_unique` here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]