mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 18:57:35 +00:00
AK: Use the correct data types in bitap_bitwise()
Otherwise the bit twiddling goes all wrong and breaks some boundary cases. Fixes `StringView::contains(31-chars)`.
This commit is contained in:
parent
ae60357951
commit
0d6dc74951
2 changed files with 9 additions and 2 deletions
|
@ -19,10 +19,10 @@ constexpr void const* bitap_bitwise(void const* haystack, size_t haystack_length
|
|||
{
|
||||
VERIFY(needle_length < 32);
|
||||
|
||||
u64 lookup = 0xfffffffe;
|
||||
u32 lookup = 0xfffffffe;
|
||||
|
||||
constexpr size_t mask_length = (size_t)((u8)-1) + 1;
|
||||
u64 needle_mask[mask_length];
|
||||
u32 needle_mask[mask_length];
|
||||
|
||||
for (size_t i = 0; i < mask_length; ++i)
|
||||
needle_mask[i] = 0xffffffff;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue