Skip to content

Commit 98970e6

Browse files
committed
Use get unchecked
1 parent 3a68a0b commit 98970e6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/day23.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ pub fn part1(s: &str) -> u64 {
4444

4545
let mut sum = 0;
4646
for c in 0..26 {
47-
for con in &connections[c as usize] {
47+
for con in connections.get_unchecked(c as usize) {
4848
if *con < c {
4949
continue;
5050
}
51-
for concon in &connections[*con as usize] {
51+
for concon in connections.get_unchecked(*con as usize) {
5252
if *concon < *con {
5353
continue;
5454
}
55-
for conconcon in &connections[*concon as usize] {
55+
for conconcon in connections.get_unchecked(*concon as usize) {
5656
if *conconcon == c {
5757
sum += 1;
5858
break;

0 commit comments

Comments
 (0)