mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-14 10:59:24 +02:00
Instead of generating items lazily during iteration (and using a lookahead queue for peeking), we now pre-generate all items upfront in the constructor. This allows next() and next_non_whitespace_sequence_width() to be simple O(1) array accesses instead of doing generation work. To handle tabs correctly (which need to know the accumulated width of content before them on the line), we track m_accumulated_width_for_tabs during pre-generation and reset it on forced breaks.
19 KiB
19 KiB