summaryrefslogtreecommitdiff
path: root/AK/MemMem.h
diff options
context:
space:
mode:
authorMacDue <macdue@dueutil.tech>2023-02-05 19:02:54 +0000
committerLinus Groh <mail@linusgroh.de>2023-02-08 19:15:45 +0000
commit63b11030f03e5a0fd06d9c8cfa788da0388096d8 (patch)
tree3ea0fa1e751683b643c71da95b6ecf98a97508cf /AK/MemMem.h
parent1c92e6ee9d1f686f20f37445150d63ae474b7e9b (diff)
downloadserenity-63b11030f03e5a0fd06d9c8cfa788da0388096d8.zip
Everywhere: Use ReadonlySpan<T> instead of Span<T const>
Diffstat (limited to 'AK/MemMem.h')
-rw-r--r--AK/MemMem.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/AK/MemMem.h b/AK/MemMem.h
index 1d36550f09..3853858d48 100644
--- a/AK/MemMem.h
+++ b/AK/MemMem.h
@@ -43,7 +43,7 @@ constexpr void const* bitap_bitwise(void const* haystack, size_t haystack_length
}
template<typename HaystackIterT>
-inline Optional<size_t> memmem(HaystackIterT const& haystack_begin, HaystackIterT const& haystack_end, Span<u8 const> needle)
+inline Optional<size_t> memmem(HaystackIterT const& haystack_begin, HaystackIterT const& haystack_end, ReadonlyBytes needle)
requires(requires { (*haystack_begin).data(); (*haystack_begin).size(); })
{
auto prepare_kmp_partial_table = [&] {
@@ -123,7 +123,7 @@ inline Optional<size_t> memmem_optional(void const* haystack, size_t haystack_le
}
// Fallback to KMP.
- Array<Span<u8 const>, 1> spans { Span<u8 const> { (u8 const*)haystack, haystack_length } };
+ Array<ReadonlyBytes, 1> spans { ReadonlyBytes { (u8 const*)haystack, haystack_length } };
return memmem(spans.begin(), spans.end(), { (u8 const*)needle, needle_length });
}