From 32e7fb3bb63ab8dc61a76a7386af901b4f2ae567 Mon Sep 17 00:00:00 2001 From: Ian-Bright Date: Sat, 30 Nov 2024 21:03:48 +0530 Subject: [PATCH] feat: apply optimization to find_zeroes function --- lib/src/remove_soft_line_breaks.nr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/remove_soft_line_breaks.nr b/lib/src/remove_soft_line_breaks.nr index 7551c36..2332f99 100644 --- a/lib/src/remove_soft_line_breaks.nr +++ b/lib/src/remove_soft_line_breaks.nr @@ -37,7 +37,7 @@ pub fn find_zeroes(encoded: [u8; N]) -> [bool; N] { let mut should_zero: [bool; N] = [false; N]; should_zero[0] = is_break[0]; should_zero[1] = is_break[1] + is_break[0]; - should_zero[N - 1] = is_break[N - 2] + is_break[N - 3]; + should_zero[N - 1] = is_break[N - 3]; for i in 2..N - 1 { should_zero[i] = is_break[i] + is_break[i - 1] + is_break[i - 2]; }