diff --git a/crates/aiken-lang/src/gen_uplc.rs b/crates/aiken-lang/src/gen_uplc.rs index d6f4c4b6..588edc00 100644 --- a/crates/aiken-lang/src/gen_uplc.rs +++ b/crates/aiken-lang/src/gen_uplc.rs @@ -217,10 +217,8 @@ impl<'a> CodeGenerator<'a> { fn finalize(&mut self, mut term: Term) -> Program { term = self.special_functions.apply_used_functions(term); - println!("PROG BEFORE IS {}", term.to_pretty()); - let program = aiken_optimize_and_intern(self.new_program(term)); - println!("PROG IS {}", program.to_pretty()); + let program = aiken_optimize_and_intern(self.new_program(term)); // This is very important to call here. // If this isn't done, re-using the same instance diff --git a/crates/aiken-project/src/tests/gen_uplc.rs b/crates/aiken-project/src/tests/gen_uplc.rs index a5129296..73f91e23 100644 --- a/crates/aiken-project/src/tests/gen_uplc.rs +++ b/crates/aiken-project/src/tests/gen_uplc.rs @@ -64,7 +64,6 @@ fn assert_uplc(source_code: &str, expected: Term, should_fail: bool, verbo version: (1, 1, 0), term: expected, }; - println!("BEFORE OPT IS {}", expected.to_pretty()); let expected = optimize::aiken_optimize_and_intern(expected); diff --git a/crates/uplc/src/optimize/shrinker.rs b/crates/uplc/src/optimize/shrinker.rs index 0b37631d..5d6b6010 100644 --- a/crates/uplc/src/optimize/shrinker.rs +++ b/crates/uplc/src/optimize/shrinker.rs @@ -90,8 +90,8 @@ pub const NO_INLINE: &str = "__no_inline__"; #[derive(PartialEq, PartialOrd, Default, Debug, Clone)] pub struct VarLookup { found: bool, - occurrences: isize, - delays: isize, + occurrences: usize, + delays: usize, no_inline: bool, } @@ -123,7 +123,7 @@ impl VarLookup { } } - pub fn delay_if_found(self, delay_amount: isize) -> Self { + pub fn delay_if_found(self, delay_amount: usize) -> Self { if self.found { Self { found: self.found, @@ -1113,7 +1113,7 @@ impl Term { } } Term::Delay(body) => { - let not_forced = isize::from(force_stack.pop().is_none()); + let not_forced = usize::from(force_stack.pop().is_none()); body.var_occurrences(search_for, arg_stack, force_stack) .delay_if_found(not_forced) @@ -1130,7 +1130,7 @@ impl Term { { VarLookup::new() } else { - let not_applied: isize = isize::from(arg_stack.pop().is_none()); + let not_applied = usize::from(arg_stack.pop().is_none()); body.var_occurrences(search_for, arg_stack, force_stack) .delay_if_found(not_applied) }