Skip to content

Commit ff7db1a

Browse files
committed
Revert "More statics"
This reverts commit 50a3610.
1 parent 50a3610 commit ff7db1a

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/day10.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,12 @@ pub fn part1(s: &str) -> u32 {
1111
static mut MAPS_PART1: [[u64; BIG_SIZE]; 9] = [[0; BIG_SIZE]; 9];
1212
static mut MAPS_PART2: [[u16; BIG_SIZE]; 9] = [[0; BIG_SIZE]; 9];
1313

14-
static mut POSITIONS_PART1: [(u16, [u16; MAX_SIZE * MAX_SIZE / 9]); 9] =
15-
[(0u16, [0u16; MAX_SIZE * MAX_SIZE / 9]); 9];
16-
static mut POSITIONS_PART2: [(u16, [u16; MAX_SIZE * MAX_SIZE / 9]); 9] =
17-
[(0u16, [0u16; MAX_SIZE * MAX_SIZE / 9]); 9];
18-
1914
#[target_feature(enable = "avx2,bmi1,bmi2,cmpxchg16b,lzcnt,movbe,popcnt")]
2015
unsafe fn part1_inner(s: &str) -> u32 {
2116
let s = s.as_bytes();
2217

23-
let positions = &mut *(&raw mut POSITIONS_PART1);
24-
let maps = &mut *(&raw mut MAPS_PART1);
18+
let mut positions = [(0u16, [0u16; MAX_SIZE * MAX_SIZE / 9]); 9];
19+
let maps = &mut MAPS_PART1;
2520
let mut zero_pos = 0;
2621

2722
let mut y = 0;
@@ -89,8 +84,8 @@ pub fn part2(s: &str) -> u16 {
8984
unsafe fn part2_inner(s: &str) -> u16 {
9085
let s = s.as_bytes();
9186

92-
let positions = &mut *(&raw mut POSITIONS_PART2);
93-
let maps = &mut *(&raw mut MAPS_PART2);
87+
let mut positions = [(0u16, [0u16; MAX_SIZE * MAX_SIZE / 9]); 9];
88+
let mut maps = &mut MAPS_PART2;
9489

9590
let mut y = 0;
9691
let mut x = 0;

0 commit comments

Comments
 (0)