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

AK: Add an optional starting offset to CircularBuffer::offset_of

This parameter allows to start searching after an offset. For example,
to resume a search.

It is unfortunately a breaking change in API so this patch also modifies
one user and one test.
This commit is contained in:
Lucas CHOLLET 2023-01-07 13:09:20 -05:00 committed by Andrew Kaster
parent 34922c0cc0
commit 9a7accddb7
4 changed files with 57 additions and 9 deletions

View file

@ -36,7 +36,7 @@ public:
[[nodiscard]] size_t used_space() const;
[[nodiscard]] size_t capacity() const;
Optional<size_t> offset_of(StringView needle, Optional<size_t> until = {}) const;
Optional<size_t> offset_of(StringView needle, Optional<size_t> from = {}, Optional<size_t> until = {}) const;
void clear();