Skip to content

Commit

Permalink
fix: update search logic to allow effective search on the last word
Browse files Browse the repository at this point in the history
  • Loading branch information
GROOOOAAAARK committed Dec 15, 2024
1 parent 1074a40 commit 9232efc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cli.zig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn contains_subsequence(haystack: []const u8, needle: []const u8) bool {
var buf1: [1024]u8 = undefined;
var buf2: [1024]u8 = undefined;
const lower_needle = std.ascii.lowerString(&buf1, needle);
for (0..haystack_len - needle_len - 1) |i| {
for (0..haystack_len - needle_len + 1) |i| {
const lower_haystack = std.ascii.lowerString(&buf2, haystack[i .. i + needle_len]);
if (std.mem.eql(u8, lower_haystack, lower_needle)) {
return true;
Expand Down

0 comments on commit 9232efc

Please sign in to comment.