Skip to content

Commit c48f6ef

Browse files
committed
Shrink container sizes
1 parent efc9a3a commit c48f6ef

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/day20.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,9 @@ const QUADS_NEEDED: usize = 20usize.div_ceil(QUAD_SIZE);
155155
fn inner_part2(s: &[u8]) -> u32 {
156156
let start = memchr::memchr(b'S', s).unwrap();
157157

158-
let mut lines = [const { heapless::Vec::<Line, 2048>::new() }; 4];
159-
let mut quads = [const {
160-
[const { heapless::Vec::<usize, { QUAD_SIZE * 2 }>::new() }; QUADS_SIZE * QUADS_SIZE]
161-
}; 4];
158+
let mut lines = [const { heapless::Vec::<Line, 1024>::new() }; 4];
159+
let mut quads =
160+
[const { [const { heapless::Vec::<usize, 32>::new() }; QUADS_SIZE * QUADS_SIZE] }; 4];
162161

163162
let mut i = start;
164163
let mut d = if s[i - 1] == b'.' {
@@ -367,6 +366,8 @@ fn inner_part2(s: &[u8]) -> u32 {
367366
}
368367
}
369368
}
369+
// dbg!(quads.iter().flat_map(|q| q.iter().map(|q| q.len())).max());
370+
// dbg!(lines.iter().map(|l| l.len()).max());
370371
// dbg!(&quads);
371372
// dbg!(&lines);
372373

0 commit comments

Comments
 (0)