tustvold commented on code in PR #2836:
URL: https://github.com/apache/arrow-rs/pull/2836#discussion_r989001479
##########
arrow-array/src/array/list_array.rs:
##########
@@ -43,6 +43,17 @@ impl OffsetSizeTrait for i64 {
const PREFIX: &'static str = "Large";
}
+/// Returns a slice of `OffsetSize` consisting of a single zero value
+#[inline]
+pub(crate) fn empty_offsets<OffsetSize: OffsetSizeTrait>() -> &'static
[OffsetSize] {
+ static OFFSET: &[i64] = &[0];
Review Comment:
This slightly odd construction is necessary to workaround the fact Rust
doesn't allow statics that depend on type parameters. It gets const folded away
by the compiler
--
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]