mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Remove BitStream workaround for now-resolved BufferedStream behavior
The issue was that the buffer would only be filled if it was empty.
This commit is contained in:
parent
13573a6c4b
commit
7319deb03d
Notes:
sideshowbarker
2024-07-17 14:36:19 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/7319deb03d Pull-request: https://github.com/SerenityOS/serenity/pull/18093 Reviewed-by: https://github.com/LucasChollet
1 changed files with 2 additions and 11 deletions
|
@ -234,19 +234,10 @@ private:
|
|||
size_t bytes_to_read = bits_to_read / bits_per_byte;
|
||||
|
||||
BufferType buffer = 0;
|
||||
|
||||
Bytes bytes { &buffer, bytes_to_read };
|
||||
size_t bytes_read = 0;
|
||||
|
||||
// FIXME: When the underlying stream is buffered, `read_some` seems to stop before EOF.
|
||||
do {
|
||||
auto result = TRY(m_stream->read_some(bytes));
|
||||
bytes = bytes.slice(result.size());
|
||||
bytes_read += result.size();
|
||||
} while (!bytes.is_empty() && !m_stream->is_eof());
|
||||
auto bytes = TRY(m_stream->read_some({ &buffer, bytes_to_read }));
|
||||
|
||||
m_bit_buffer = (buffer << m_bit_count) | lsb_aligned_buffer();
|
||||
m_bit_count += bytes_read * bits_per_byte;
|
||||
m_bit_count += bytes.size() * bits_per_byte;
|
||||
m_bit_offset = 0;
|
||||
|
||||
return {};
|
||||
|
|
Loading…
Reference in a new issue