Skip to content

Commit

Permalink
Optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
alion02 committed Dec 6, 2024
1 parent 3a9c86f commit 10f3582
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/day6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ unsafe fn inner1(s: &[u8]) -> u32 {
break 'outer;
}
if *s.get_unchecked(next) == b'#' {
loc = loc.wrapping_add(1);
break;
}
loc = next;
Expand All @@ -27,6 +28,7 @@ unsafe fn inner1(s: &[u8]) -> u32 {
break 'outer;
}
if *s.get_unchecked(next) == b'#' {
loc = loc.wrapping_add(131);
break;
}
loc = next;
Expand All @@ -39,6 +41,7 @@ unsafe fn inner1(s: &[u8]) -> u32 {
break 'outer;
}
if *s.get_unchecked(next) == b'#' {
loc = loc.wrapping_sub(1);
break;
}
loc = next;
Expand All @@ -51,6 +54,7 @@ unsafe fn inner1(s: &[u8]) -> u32 {
break 'outer;
}
if *s.get_unchecked(next) == b'#' {
loc = loc.wrapping_sub(131);
break;
}
loc = next;
Expand Down

0 comments on commit 10f3582

Please sign in to comment.