Dandandan commented on code in PR #7513:
URL: https://github.com/apache/arrow-rs/pull/7513#discussion_r2122271329
##########
arrow-array/src/array/byte_view_array.rs:
##########
@@ -538,6 +538,18 @@ impl<T: ByteViewType + ?Sized> GenericByteViewArray<T> {
l_full_data.cmp(r_full_data)
}
+
+ /// return the total number of bytes required to hold all strings pointed
to by views in this array
+ pub fn minimum_buffer_size(&self) -> usize {
Review Comment:
probably compiles to the same, but I think using `sum` is slightly more
idiomatic.
```
self.views.iter()
.map(|v| {
let len = (*v as u32) as usize;
if len > 12 {
len
} else {
0
}
})
.sum()
```
--
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]