8000 update to latest zig · ziglibs/string-searching@c472d4b · GitHub
[go: up one dir, main page]

Skip to content

Commit c472d4b

Browse files
update to latest zig
zig version 0.11.0-dev.3036+e21739dd8
1 parent b8054a8 commit c472d4b

File tree

3 files changed

+7
-6
lines changed

3 files changed
+7
-6
lines changed

build.zig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ pub fn build(b: *Builder) void {
55
const optimize = b.standardOptimizeOption(.{});
66

77
var main_tests = b.addTest(.{
8-
.name = "main test suite",
98
.root_source_file = .{ .path = "src/main.zig" },
109
.target = target,
1110
.optimize = optimize,
1211
});
1312

13+
const run_main_tests = b.addRunArtifact(main_tests);
14+
1415
const test_step = b.step("test", "Run library tests");
15-
test_step.dependOn(&main_tests.step);
16+
test_step.dependOn(&run_main_tests.step);
1617
}

src/bitap.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ pub fn bitap(
3131
var R: Int = ~one;
3232
var pattern_mask = [_]Int{std.math.maxInt(Int)} ** possible_values;
3333

34-
for (pattern) |x, i| {
34+
for (pattern, 0..) |x, i| {
3535
pattern_mask[x] &= ~(one << @intCast(Log2Int, i));
3636
}
3737

38-
for (text) |x, i| {
38+
for (text, 0..) |x, i| {
3939
R |= pattern_mask[x];
4040
R <<= 1;
4141

src/boyer_moore.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ pub fn StringFinder(comptime T: type) type {
5353
const last = pattern.len - 1;
5454

5555
// Initialize bad character rule table
56-
for (self.bad_char) |*x| x.* = pattern.len;
56+
for (&self.bad_char) |*x| x.* = pattern.len;
5757

58-
for (pattern) |x, i| {
58+
for (pattern, 0..) |x, i| {
5959
if (i == last) break;
6060
self.bad_char[x] = last - i;
6161
}

0 commit comments

Comments
 (0)
0