mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-05 16:14:38 +00:00
AK: Remove OutputMemoryStream for DuplexMemoryStream.
OutputMemoryStream was originally a proxy for DuplexMemoryStream that did not expose any reading API. Now I need to add another class that is like OutputMemoryStream but only for static buffers. My first idea was to make OutputMemoryStream do that too, but I think it's much better to have a distinct class for that. I originally wanted to call that class FixedOutputMemoryStream but that name is really cumbersome and it's a bit unintuitive because InputMemoryStream is already reading from a fixed buffer. So let's just use DuplexMemoryStream instead of OutputMemoryStream for any dynamic stuff and create a new OutputMemoryStream for static buffers.
This commit is contained in:
@@ -1107,7 +1107,7 @@ void Execute::for_each_entry(RefPtr<Shell> shell, Function<IterationDecision(Ref
|
||||
} while (action == Continue);
|
||||
|
||||
if (!stream.eof()) {
|
||||
auto entry = ByteBuffer::create_uninitialized(stream.remaining());
|
||||
auto entry = ByteBuffer::create_uninitialized(stream.size());
|
||||
auto rc = stream.read_or_error(entry);
|
||||
ASSERT(rc);
|
||||
callback(create<StringValue>(String::copy(entry)));
|
||||
|
||||
Reference in New Issue
Block a user