1
0
Fork 0
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:
Andreas Kling 2020-01-15 22:09:45 +01:00
parent 09fd59a1b5
commit 5a13a5416e
Notes: sideshowbarker 2024-07-19 10:02:32 +09:00

View file

@ -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);