paleolimbot commented on code in PR #710:
URL: https://github.com/apache/arrow-nanoarrow/pull/710#discussion_r1947849406


##########
src/nanoarrow/common/inline_array.h:
##########
@@ -772,6 +787,59 @@ static inline ArrowErrorCode 
ArrowArrayFinishElement(struct ArrowArray* array) {
         return EINVAL;
       }
       break;
+    case NANOARROW_TYPE_LIST_VIEW: {
+      child_length = array->children[0]->length;
+      if (child_length > INT32_MAX) {
+        return EOVERFLOW;
+      }
+
+      const int32_t current_offset = (int32_t)private_data->list_view_offset;
+      int32_t offset;
+      if (current_offset == 0) {
+        offset = 0;
+      } else {
+        struct ArrowBuffer offsets_buf, sizes_buf;
+        offsets_buf = *ArrowArrayBuffer(array, 1);
+        sizes_buf = *ArrowArrayBuffer(array, 2);

Review Comment:
   Got it! I think it's still a good change for future code readers (the 
`ArrowBuffer` should really never be copied by value!)



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to