maartenbreddels commented on a change in pull request #7449:
URL: https://github.com/apache/arrow/pull/7449#discussion_r447170380



##########
File path: cpp/src/arrow/compute/kernels/scalar_string.cc
##########
@@ -133,23 +134,23 @@ struct Utf8Transform {
         output_string_offsets[i + 1] = output_ncodeunits;
       }
 
-      // trim the codepoint buffer, since we allocated too much
+      // Trim the codepoint buffer, since we allocated too much
       KERNEL_RETURN_IF_ERROR(
-          ctx,
-          output->buffers[2]->CopySlice(0, 
output_ncodeunits).Value(&output->buffers[2]));
+          ctx, values_buffer->Resize(output_ncodeunits, 
/*shrink_to_fit=*/true));

Review comment:
       Nice way to make code more readable.




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

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


Reply via email to