From 0f5e11a79f2a067d005696fcfcfbd3fa669ffab6 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Thu, 7 Dec 2023 10:43:08 +0100 Subject: [PATCH] day(05): add todo and comment out unused Signed-off-by: Matej Focko --- src/bin/day05.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/bin/day05.rs b/src/bin/day05.rs index 5a05a58..a3c55c9 100644 --- a/src/bin/day05.rs +++ b/src/bin/day05.rs @@ -43,14 +43,14 @@ impl AlmanacRange { Some(self.destination + (key - self.source)) } - fn maps_to(&self) -> (i64, i64) { - (self.destination, self.destination + self.length) - } + // fn maps_to(&self) -> (i64, i64) { + // (self.destination, self.destination + self.length) + // } - fn overlaps(&self, start: i64, length: i64) -> bool { - (start < self.source || self.has(start)) - && (start + length >= self.upper_bound() || self.has(start + length)) - } + // fn overlaps(&self, start: i64, length: i64) -> bool { + // (start < self.source || self.has(start)) + // && (start + length >= self.upper_bound() || self.has(start + length)) + // } } struct Mapping { @@ -102,6 +102,8 @@ impl Solution for Day05 { } fn part_2(&mut self) -> Output2 { + // TODO: Optimize this part, + // even though it runs in 20s with rayon and release build let indices = (0..self.seeds.len()) .map(|i| 2 * i) .take_while(|i| *i < self.seeds.len() - 1)