mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 17:44:56 +09:00
Kernel: Avoid an extra call to read_bytes() in Inode::read_entire()
If we slurp up the entire inode in a single read_bytes(), no need to call read_bytes() again.
This commit is contained in:
parent
09fd59a1b5
commit
5a13a5416e
Notes:
sideshowbarker
2024-07-19 10:02:32 +09:00
Author: https://github.com/awesomekling
Commit: 5a13a5416e
1 changed files with 2 additions and 0 deletions
|
@ -45,6 +45,8 @@ ByteBuffer Inode::read_entire(FileDescription* descriptor) const
|
|||
break;
|
||||
builder.append((const char*)buffer, nread);
|
||||
offset += nread;
|
||||
if (nread < (ssize_t)sizeof(buffer))
|
||||
break;
|
||||
}
|
||||
if (nread < 0) {
|
||||
kprintf("Inode::read_entire: ERROR: %d\n", nread);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue