fix: less allocations

Co-authored-by: str4d <thestr4d@gmail.com>
This commit is contained in:
Volker Mische 2022-03-11 17:37:47 +01:00 committed by GitHub
parent 870939ab03
commit cc51340dc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,6 +11,6 @@ pub use fq::*;
fn u64_to_u32(limbs: &[u64]) -> alloc::vec::Vec<u32> {
limbs
.iter()
.flat_map(|limb| alloc::vec![(limb & 0xFFFF_FFFF) as u32, (limb >> 32) as u32])
.flat_map(|limb| Some((limb & 0xFFFF_FFFF) as u32).into_iter().chain(Some((limb >> 32) as u32)))
.collect()
}