Skip to content

Commit d6c71d4

Browse files
committed
Fix operator precedence
1 parent 8991a07 commit d6c71d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/year2016/day18.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fn count(input: &str, rows: u32) -> u32 {
4141
// Count the traps in each row.
4242
total += row.count_ones();
4343
// Only consider the left and right values for the next row.
44-
row = (row << 1) ^ (row >> 1) & mask;
44+
row = ((row << 1) ^ (row >> 1)) & mask;
4545
}
4646

4747
// We want the number of safe tiles so convert from the number of traps.

0 commit comments

Comments
 (0)