authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-03-20 11:39:30 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-03-20 11:39:30 -07:00
log550cabd5a18ace5e67761bc5b867c10e926f4314
tree23333759c85a634096d8e672a5b258efa6c83986
parentab852cf74fa0b4edc530d925f0654b62c60365bf

update to zig master 0.11.0-dev.1681+0bb178bbb


1 files changed, 3 insertions(+), 3 deletions(-)

src/lib.zig+3-3
......@@ -53,17 +53,17 @@ pub fn leven(comptime T: type, alloc: std.mem.Allocator, a: []const T, b: []cons
5353 const array = try alloc.alloc(usize, ll);
5454 defer alloc.free(array);
5555
56 for (range(ll)) |_, i| {
56 for (range(ll), 0..) |_, i| {
5757 charCodeCache[i] = left[start + i];
5858 array[i] = i + 1;
5959 }
6060
61 for (range(rl)) |_, j| {
61 for (range(rl), 0..) |_, j| {
6262 const bCharCode = right[start + j];
6363 var temp = j;
6464 result = j + 1;
6565
66 for (range(ll)) |_, i| {
66 for (range(ll), 0..) |_, i| {
6767 const temp2 = if (bCharCode == charCodeCache[i]) temp else temp + 1;
6868 temp = array[i];
6969 array[i] = if (temp > result) (if (temp2 > result) result + 1 else temp2) else (if (temp2 > temp) temp + 1 else temp2);