1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:37:34 +00:00

AK: Move parts for searching CircularBuffer into a new class

We will be adding extra logic to the CircularBuffer to optimize
searching, but this would negatively impact the performance of
CircularBuffer users that don't need that functionality.
This commit is contained in:
Tim Schumacher 2023-06-01 20:48:35 +02:00 committed by Linus Groh
parent 40c0dd67dd
commit 9e82ad758e
6 changed files with 50 additions and 16 deletions

View file

@ -335,7 +335,7 @@ TEST_CASE(find_copy_in_seekback)
auto needle = "ABCD"sv.bytes();
// Set up the buffer for testing.
auto buffer = MUST(CircularBuffer::create_empty(haystack.size() + needle.size()));
auto buffer = MUST(SearchableCircularBuffer::create_empty(haystack.size() + needle.size()));
auto written_haystack_bytes = buffer.write(haystack);
VERIFY(written_haystack_bytes == haystack.size());
MUST(buffer.discard(haystack.size()));