aboutsummaryrefslogtreecommitdiff
path: root/day3.zig
diff options
context:
space:
mode:
Diffstat (limited to 'day3.zig')
-rw-r--r--day3.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/day3.zig b/day3.zig
index 04c432f..9bea1ab 100644
--- a/day3.zig
+++ b/day3.zig
@@ -17,7 +17,7 @@ const Grid = struct {
span_ix: []usize, // grid mapping of index into spans list
fn init(a: std.mem.Allocator, input: []const u8) !Grid {
- var spix = try a.alloc(usize, input.len);
+ const spix = try a.alloc(usize, input.len);
@memset(spix, std.math.maxInt(usize));
errdefer a.free(spix);
@@ -173,10 +173,10 @@ fn solve_pt2(a: std.mem.Allocator, input: []const u8) !u32 {
}
var ki = spixes.keyIterator();
if (ki.next()) |first| {
- var m = allSpans.items[first.*];
+ const m = allSpans.items[first.*];
//std.log.warn("span val m{}", .{m});
if (ki.next()) |second| {
- var m2 = allSpans.items[second.*];
+ const m2 = allSpans.items[second.*];
//std.log.warn("span val m2{}", .{m2});
// _EXACTLY_ two gears!
if (ki.next() == null) {