From 550cabd5a18ace5e67761bc5b867c10e926f4314 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Mon, 20 Mar 2023 11:39:30 -0700 Subject: [PATCH] update to zig master 0.11.0-dev.1681+0bb178bbb --- src/lib.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.zig b/src/lib.zig index 816270979d26fa877ba4e30326e30455326509e4..20f87c9ae51bf9aa403baa50d49275a1eb75a436 100644 --- a/src/lib.zig +++ b/src/lib.zig @@ -53,17 +53,17 @@ pub fn leven(comptime T: type, alloc: std.mem.Allocator, a: []const T, b: []cons const array = try alloc.alloc(usize, ll); defer alloc.free(array); - for (range(ll)) |_, i| { + for (range(ll), 0..) |_, i| { charCodeCache[i] = left[start + i]; array[i] = i + 1; } - for (range(rl)) |_, j| { + for (range(rl), 0..) |_, j| { const bCharCode = right[start + j]; var temp = j; result = j + 1; - for (range(ll)) |_, i| { + for (range(ll), 0..) |_, i| { const temp2 = if (bCharCode == charCodeCache[i]) temp else temp + 1; temp = array[i]; array[i] = if (temp > result) (if (temp2 > result) result + 1 else temp2) else (if (temp2 > temp) temp + 1 else temp2); -- 2.54.0