Skip to content

Commit

Permalink
Clean up Extract a bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviusb committed Sep 8, 2024
1 parent 7befa2b commit 2c3766e
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions examples/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,8 @@ do_with_in!{
extract_wrapper = { $8 })
impl Extract<$MEM_STORE_TYPE, $MEM_STORE_TYPE_SIZE, $MEM_STORE_CHUNKS, $MEM_RETURN_TYPE, $MEM_RETURN_TYPE_SIZE, $MEM_RETURN_CHUNKS, $BITS> for [$MEM_STORE_TYPE; $MEM_STORE_CHUNKS] {
fn extract(&self, start: usize) -> [$MEM_RETURN_TYPE; $MEM_RETURN_CHUNKS] {
let base: usize = (start / $MEM_STORE_TYPE_SIZE) % $MEM_STORE_CHUNKS;
let first_bit: usize = start % $MEM_STORE_TYPE_SIZE;
let mut out: [$MEM_STORE_TYPE; $MEM_STORE_CHUNKS] = [0; $MEM_STORE_CHUNKS];
//
let mut current_bit = first_bit;
let mut through: usize = 0;
while through < $BITS {
let return_chunk_start_at = (through % $MEM_RETURN_TYPE_SIZE);
Expand Down

0 comments on commit 2c3766e

Please sign in to comment.