Skip to content

Commit

Permalink
Move is_bit_set into match body
Browse files Browse the repository at this point in the history
  • Loading branch information
ardikars committed Aug 24, 2023
1 parent 8a40f9c commit 0247f7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/traverse_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ pub fn traverse_path(allocator: &Allocator, node_index: &[u8], args: NodePtr) ->
let mut byte_idx = node_index.len() - 1;
let mut bitmask = 0x01;
while byte_idx > first_bit_byte_index || bitmask < last_bitmask {
let is_bit_set: bool = (node_index[byte_idx] & bitmask) != 0;
match allocator.sexp(arg_list) {
SExp::Atom => {
return Err(EvalErr(arg_list, "path into atom".into()));
}
SExp::Pair(left, right) => {
let is_bit_set = (node_index[byte_idx] & bitmask) != 0;
arg_list = if is_bit_set { right } else { left };
}
}
Expand Down

0 comments on commit 0247f7d

Please sign in to comment.