summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorLucas CHOLLET <lucas.chollet@free.fr>2022-12-17 01:42:02 +0100
committerAndrew Kaster <andrewdkaster@gmail.com>2023-01-14 16:20:30 -0700
commit4402720a15c38b317faff3d27be200cf622401d3 (patch)
tree66ebf501822771b957d0db44fd67b33b8578b0af /Userland/Libraries
parent8252436c188e183527bd425cecbc403c6282e0bb (diff)
downloadserenity-4402720a15c38b317faff3d27be200cf622401d3.zip
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.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibCore/Stream.h4
1 files changed, 0 insertions, 4 deletions
diff --git a/Userland/Libraries/LibCore/Stream.h b/Userland/Libraries/LibCore/Stream.h
index 4fae0b02ad..25f5f6c580 100644
--- a/Userland/Libraries/LibCore/Stream.h
+++ b/Userland/Libraries/LibCore/Stream.h
@@ -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()) {