tustvold commented on code in PR #3026:
URL: https://github.com/apache/arrow-rs/pull/3026#discussion_r1014727497


##########
arrow-buffer/src/bigint.rs:
##########
@@ -369,6 +373,20 @@ impl i256 {
     }
 }
 
+/// Temporary workaround due to lack of stable const array slicing
+/// See <https://github.com/rust-lang/rust/issues/90091>
+const fn split_array(vals: [u8; 32]) -> ([u8; 16], [u8; 16]) {
+    let mut a = [0; 16];
+    let mut b = [0; 16];
+    let mut i = 0;
+    while i != 16 {
+        a[i] = vals[i];
+        b[i] = vals[i + 16];
+        i += 1;
+    }
+    (a, b)
+}

Review Comment:
   Arrays are stack allocated, and in practice the compiler will optimise all 
of this away



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