diff options
author | Christian Segundo | 2022-12-12 21:15:29 +0100 |
---|---|---|
committer | Christian Segundo | 2022-12-12 21:15:29 +0100 |
commit | 2242f3122f6c80d46baab92a34df39706f6737b0 (patch) | |
tree | fbf0dead111f6101f669cba3136a746842e74cc0 | |
parent | fcebc0d7d7b196341c512a3a48838b1d9f233f1b (diff) | |
download | advent-of-zig-2022-2242f3122f6c80d46baab92a34df39706f6737b0.tar.gz |
remove bogus condition
-rw-r--r-- | day_12.zig | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -56,8 +56,7 @@ fn bfs(allocator: std.mem.Allocator, grid: [][]const u8, start: []Point, end: Po if (!(p.row >= 0 and p.col >= 0 and p.row < grid.len and p.col < grid[0].len)) continue; if (visited.contains([_]i32{ p.row, p.col })) continue; - if (grid[@intCast(usize, point.row)][@intCast(usize, point.col)] != 'S' and grid[@intCast(usize, p.row)][@intCast(usize, p.col)] != 'E') - if (grid[@intCast(usize, p.row)][@intCast(usize, p.col)] > (grid[@intCast(usize, point.row)][@intCast(usize, point.col)] + 1)) continue; + if (grid[@intCast(usize, p.row)][@intCast(usize, p.col)] > (grid[@intCast(usize, point.row)][@intCast(usize, point.col)] + 1)) continue; queue.append(p) catch unreachable; } |