pitrou commented on code in PR #38873:
URL: https://github.com/apache/arrow/pull/38873#discussion_r1408145751


##########
cpp/src/gandiva/random_generator_holder.cc:
##########
@@ -38,8 +37,7 @@ Status RandomGeneratorHolder::Make(const FunctionNode& node,
       literal_type != arrow::Type::INT32,
       Status::Invalid("'random' function requires an int32 literal as 
parameter"));
 
-  *holder = std::shared_ptr<RandomGeneratorHolder>(new RandomGeneratorHolder(
+  return std::shared_ptr<RandomGeneratorHolder>(new RandomGeneratorHolder(

Review Comment:
   Same here.



##########
cpp/src/gandiva/random_generator_holder.cc:
##########
@@ -19,14 +19,13 @@
 #include "gandiva/node.h"
 
 namespace gandiva {
-Status RandomGeneratorHolder::Make(const FunctionNode& node,
-                                   std::shared_ptr<RandomGeneratorHolder>* 
holder) {
+Result<std::shared_ptr<RandomGeneratorHolder>> RandomGeneratorHolder::Make(
+    const FunctionNode& node) {
   ARROW_RETURN_IF(node.children().size() > 1,
                   Status::Invalid("'random' function requires at most one 
parameter"));
 
   if (node.children().size() == 0) {
-    *holder = std::shared_ptr<RandomGeneratorHolder>(new 
RandomGeneratorHolder());
-    return Status::OK();
+    return std::shared_ptr<RandomGeneratorHolder>(new RandomGeneratorHolder());

Review Comment:
   Can probably use `std::make_shared`?



-- 
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]

Reply via email to