edponce commented on a change in pull request #12041:
URL: https://github.com/apache/arrow/pull/12041#discussion_r776588154
##########
File path: c_glib/arrow-glib/scalar.cpp
##########
@@ -2039,6 +2039,16 @@ GList *
garrow_struct_scalar_get_value(GArrowStructScalar *scalar)
{
auto priv = GARROW_STRUCT_SCALAR_GET_PRIVATE(scalar);
+ if (!priv->value) {
+ auto arrow_scalar =
+ std::static_pointer_cast<arrow::StructScalar>(
+ garrow_scalar_get_raw(GARROW_SCALAR(scalar)));
+ for (auto arrow_element : arrow_scalar->value) {
+ priv->value = g_list_prepend(priv->value,
+ garrow_scalar_new_raw(&arrow_element));
+ }
+ priv->value = g_list_reverse(priv->value);
+ }
Review comment:
Why prepend and then reverse instead of only appending?
--
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]