From 0247f7d5b7792bc8c08ea36c7510db58557b623e Mon Sep 17 00:00:00 2001 From: Ardika Rommy Sanjaya Date: Thu, 24 Aug 2023 19:41:05 +0700 Subject: [PATCH] Move is_bit_set into match body --- src/traverse_path.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/traverse_path.rs b/src/traverse_path.rs index 592a7774..30a3c362 100644 --- a/src/traverse_path.rs +++ b/src/traverse_path.rs @@ -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 }; } }