felipecrv commented on code in PR #37792:
URL: https://github.com/apache/arrow/pull/37792#discussion_r1347782770


##########
cpp/src/arrow/array/builder_binary.h:
##########
@@ -487,18 +487,42 @@ class ARROW_EXPORT StringHeapBuilder {
 
   void SetBlockSize(int64_t blocksize) { blocksize_ = blocksize; }
 
-  void UnsafeAppend(BinaryViewType::c_type* v) {
-    memcpy(current_out_buffer_, v->raw.data, v->size());
-    v->io = {v->size(), v->raw.prefix, static_cast<int32_t>(blocks_.size() - 
1),
-             current_offset_};
-    current_out_buffer_ += v->size();
-    current_remaining_bytes_ -= v->size();
-    current_offset_ += static_cast<int32_t>(v->size());
+  using c_type = BinaryViewType::c_type;
+
+  template <bool Safe>
+  std::conditional_t<Safe, Result<c_type>, c_type> Append(const uint8_t* value,
+                                                          int64_t length) {

Review Comment:
   Sorry, this is a helper class. Nvm.



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