Skip to content

Commit e2ba6aa

Browse files
committed
Update function_internal.h
1 parent 640f40f commit e2ba6aa

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

cpp/src/arrow/compute/function_internal.h

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -352,14 +352,6 @@ static inline Result<std::shared_ptr<Scalar>> GenericToScalar(
352352
return MakeNullScalar(value);
353353
}
354354

355-
static inline Result<std::shared_ptr<Scalar>> GenericToScalar(
356-
const std::optional<std::shared_ptr<DataType>>& value) {
357-
if (!value.has_value()) {
358-
return std::make_shared<NullScalar>();
359-
}
360-
return GenericToScalar(value.value());
361-
}
362-
363355
static inline Result<std::shared_ptr<Scalar>> GenericToScalar(const TypeHolder& value) {
364356
return GenericToScalar(value.GetSharedPtr());
365357
}
@@ -390,9 +382,10 @@ static inline Result<std::shared_ptr<Scalar>> GenericToScalar(std::nullopt_t) {
390382
}
391383

392384
template <typename T>
393-
static inline auto GenericToScalar(const std::optional<T>& value)
394-
-> Result<decltype(MakeScalar(value.value()))> {
395-
return value.has_value() ? MakeScalar(value.value()) : std::make_shared<NullScalar>();
385+
static inline Result<std::shared_ptr<Scalar>> GenericToScalar(
386+
const std::optional<T>& value) {
387+
return value.has_value() ? GenericToScalar(value.value())
388+
: std::make_shared<NullScalar>();
396389
}
397390

398391
template <typename T>

0 commit comments

Comments
 (0)