aboutsummaryrefslogtreecommitdiff
path: root/lib/io/test
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-06-11 15:40:26 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-06-11 15:40:26 +0200
commit366ccf20745b23f1eb8554cbe17e6972271de002 (patch)
tree93951efe96966db4c766c140431dd017fd15cf80 /lib/io/test
parentad1691aa33cfc1b1558ce10e93552d0eb1cdcd63 (diff)
libio: remove precache from istream_advance_buffer
Since the user has to call istream_get_buffered_data afterwards anyway, we can do the precache lazily. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/io/test')
-rw-r--r--lib/io/test/istream_mem.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/io/test/istream_mem.c b/lib/io/test/istream_mem.c
index f1849dd..84da9a9 100644
--- a/lib/io/test/istream_mem.c
+++ b/lib/io/test/istream_mem.c
@@ -63,11 +63,8 @@ int main(int argc, char **argv)
TEST_EQUAL_UI(ptr[j], byte_at_offset(i + j));
}
- diff = eat_all ? size : (size / 2);
+ istream_advance_buffer(in, eat_all ? size : (size / 2));
eat_all = !eat_all;
-
- ret = istream_advance_buffer(in, diff);
- TEST_EQUAL_I(ret, 0);
}
sqfs_drop(in);