1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:47:34 +00:00

ByteBuffer: Remove pointer() in favor of data()

We had two ways to get the data inside a ByteBuffer. That was silly.
This commit is contained in:
Andreas Kling 2019-09-30 08:57:01 +02:00
parent dd696e7c75
commit 8f45a259fc
30 changed files with 89 additions and 92 deletions

View file

@ -129,7 +129,7 @@ Result benchmark(const String& filename, int file_size, int block_size, ByteBuff
timer.start();
int nwrote = 0;
for (int j = 0; j < file_size; j += block_size) {
int n = write(fd, buffer.pointer(), block_size);
int n = write(fd, buffer.data(), block_size);
if (n < 0) {
perror("write");
cleanup_and_exit();
@ -146,7 +146,7 @@ Result benchmark(const String& filename, int file_size, int block_size, ByteBuff
timer.start();
int nread = 0;
while (nread < file_size) {
int n = read(fd, buffer.pointer(), block_size);
int n = read(fd, buffer.data(), block_size);
if (n < 0) {
perror("read");
cleanup_and_exit();