Skip to content

Commit

Permalink
slightly optimize labyrinth code
Browse files Browse the repository at this point in the history
Signed-off-by: Lance-Drane <ldraneutk@gmail.com>
  • Loading branch information
Lance-Drane committed Dec 3, 2023
1 parent ba65543 commit 697dcdf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bin/graph_labyrinth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ fn solve<W: std::io::Write>(mut scan: UnsafeScanner, out: &mut W) {
b'U' => end + width,
b'R' => end - 1,
b'D' => end - width,
b'L' => end + 1,
_ => unreachable!("The grid should have been modified with direction characters"),
// it's always going to be 'L' at this point
_ => end + 1,
};
letter = unsafe { *grid.get_unchecked(end) };
}
Expand Down

0 comments on commit 697dcdf

Please sign in to comment.