mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
LibCore: Don't rely on \n
detection to populate the buffer
We don't need to call `can_read_line()` as the buffer will be populated by `find_and_populate_until_any_of()`. The change is also beneficial as the buffer will be populated until a candidate is found and not necessarily a new line.
This commit is contained in:
parent
8252436c18
commit
4402720a15
Notes:
sideshowbarker
2024-07-18 02:47:59 +09:00
Author: https://github.com/LucasChollet
Commit: 4402720a15
Pull-request: https://github.com/SerenityOS/serenity/pull/16544
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/timschumi ✅
1 changed files with 0 additions and 4 deletions
|
@ -690,10 +690,6 @@ public:
|
|||
if (buffer.is_empty())
|
||||
return Error::from_errno(ENOBUFS);
|
||||
|
||||
// We fill the buffer through can_read_line.
|
||||
if (!TRY(can_read_line()))
|
||||
return Bytes {};
|
||||
|
||||
auto const candidate = TRY(find_and_populate_until_any_of(candidates, buffer.size()));
|
||||
|
||||
if (stream().is_eof()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue