Skip to content

Commit

Permalink
feat: optimized slice allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaMasych committed Jan 8, 2024
1 parent f3d1832 commit 8869855
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/ipa-multipoint/src/utils.nr
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ use dep::std::unsafe::zeroed;
// (like N*2 for weights and inverted weights in barycentric).
pub(crate) fn allocate_slice<T>(len: u64) -> [T] {
let mut res: [T] = [];

let value = zeroed();
for _ in 0..len {
res = res.push_back(zeroed());
res = res.push_back(value);
}

res
Expand All @@ -35,4 +35,4 @@ pub(crate) fn u64_to_u8(num: u64) -> [u8; 8] {
}

out
}
}

0 comments on commit 8869855

Please sign in to comment.