mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
AK: Make some Stream::read* functions available inline
These are quite bottlenecky in wasm, the next commit will try to make use of this by calling them directly instead of doing a vcall, and having them inlineable helps the compiler a bit.
This commit is contained in:
committed by
Ali Mohammad Pur
parent
bd7c188b86
commit
834fb0be36
Notes:
github-actions[bot]
2025-08-08 10:57:07 +00:00
Author: https://github.com/alimpfard Commit: https://github.com/LadybirdBrowser/ladybird/commit/834fb0be36b Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5060 Reviewed-by: https://github.com/Hendiadyoin1 Reviewed-by: https://github.com/R-Goc Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/gmta
@@ -30,7 +30,12 @@ public:
|
||||
virtual bool is_open() const override;
|
||||
virtual void close() override;
|
||||
virtual ErrorOr<void> truncate(size_t) override;
|
||||
virtual ErrorOr<Bytes> read_some(Bytes bytes) override;
|
||||
virtual ErrorOr<Bytes> read_some(Bytes bytes) override
|
||||
{
|
||||
auto read = m_bytes.slice(m_offset).copy_trimmed_to(bytes);
|
||||
m_offset += read;
|
||||
return bytes.trim(read);
|
||||
}
|
||||
virtual ErrorOr<void> read_until_filled(Bytes bytes) override;
|
||||
|
||||
virtual ErrorOr<size_t> seek(i64 offset, SeekMode seek_mode = SeekMode::SetPosition) override;
|
||||
|
||||
Reference in New Issue
Block a user