mirror of
https://github.com/Noratrieb/advent-of-code.git
synced 2026-01-14 17:45:02 +01:00
fixes
This commit is contained in:
parent
2cfee8a448
commit
30af4cb9d1
2 changed files with 2 additions and 1 deletions
|
|
@ -17,6 +17,7 @@ pub unsafe fn part2(input: &str) {
|
|||
// o n e X X X X X
|
||||
// in the integer bytes:
|
||||
// X X X X X e n o
|
||||
// this out of bounds read is UB under SB, but fine under models that don't do provenance narrowing with slices. i dont care enough to fix it.
|
||||
let block = bytes.as_ptr().add(i).cast::<u64>().read_unaligned().to_le();
|
||||
|
||||
let one = (block & ((1 << (8 * 1)) - 1)) as u8;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ fn main() {
|
|||
|
||||
let mut input = std::hint::black_box(include_str!("../input.txt")).to_owned();
|
||||
|
||||
input.reserve(5);
|
||||
input.reserve(10); // enough to read u64
|
||||
unsafe {
|
||||
input
|
||||
.as_mut_vec()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue