mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
LibCore+Everywhere: Make Core::Stream read_line() return StringView
Similar reasoning to making Core::Stream::read() return Bytes, except that every user of read_line() creates a StringView from the result, so let's just return one right away.
This commit is contained in:
@@ -88,9 +88,7 @@ ErrorOr<void> ConfigFile::reparse()
|
||||
|
||||
auto buffer = TRY(ByteBuffer::create_uninitialized(4096));
|
||||
while (TRY(m_file->can_read_line())) {
|
||||
auto length = TRY(m_file->read_line(buffer));
|
||||
|
||||
StringView line { buffer.data(), length };
|
||||
auto line = TRY(m_file->read_line(buffer));
|
||||
size_t i = 0;
|
||||
|
||||
while (i < line.length() && (line[i] == ' ' || line[i] == '\t' || line[i] == '\n'))
|
||||
|
||||
Reference in New Issue
Block a user