You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/01/09 10:08:38 UTC

[GitHub] [arrow-rs] jhorstmann commented on a change in pull request #1145: Fix undefined behavor in GenericStringArray::from_iter_values

jhorstmann commented on a change in pull request #1145:
URL: https://github.com/apache/arrow-rs/pull/1145#discussion_r780760173



##########
File path: arrow/src/array/array_string.rs
##########
@@ -187,8 +187,15 @@ impl<OffsetSize: StringOffsetSizeTrait> GenericStringArray<OffsetSize> {
             offsets.push(length_so_far);
             values.extend_from_slice(s.as_bytes());
         }
+
+        // iterator size hint may not be correct so compute the actual number of offsets
+        let actual_len = match offsets.len() {
+            0 => 0,

Review comment:
       We always push at least one offset (zero), so this match should not be needed. Looks good otherwise.




-- 
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-unsubscribe@arrow.apache.org

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