mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 16:54:52 +00:00
Use better haystack size and needle size for cutoff between linear and BMH
This commit is contained in:
parent
8af1f8ba1a
commit
ff58f09b68
@ -927,7 +927,7 @@ pub fn indexOfPos(comptime T: type, haystack: []const T, start_index: usize, nee
|
||||
if (needle.len > haystack.len) return null;
|
||||
if (needle.len == 0) return 0;
|
||||
|
||||
if (!meta.trait.hasUniqueRepresentation(T) or haystack.len < 32 or needle.len <= 2)
|
||||
if (!meta.trait.hasUniqueRepresentation(T) or haystack.len < 52 or needle.len <= 4)
|
||||
return indexOfPosLinear(T, haystack, start_index, needle);
|
||||
|
||||
const haystack_bytes = sliceAsBytes(haystack);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user