diff options
author | 2021-03-10 15:04:13 +0200 | |
---|---|---|
committer | 2021-03-10 15:33:58 +0200 | |
commit | 8788b9b33ec46e3f96170fb35a70a03addbf9671 (patch) | |
tree | 44b620061ca427f436e89c7beb80022febde1e58 /src/main.c | |
parent | d7e2af2582660e3ed4ce824c33a21ffbf9ed4c6f (diff) | |
download | algos-ld1-8788b9b33ec46e3f96170fb35a70a03addbf9671.tar.gz algos-ld1-8788b9b33ec46e3f96170fb35a70a03addbf9671.tar.bz2 algos-ld1-8788b9b33ec46e3f96170fb35a70a03addbf9671.zip |
refactor && improve.
Make code more reusable and generic while preparing to add uncached ops.
Signed-off-by: Gediminas Jakutis <gediminas@varciai.lt>
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -68,7 +68,7 @@ int main(int argc, char **argv) if (settings.format == array) { try_s((ret = cache_block_copy(&file_in, &file_out)), out); } else { /* settings.format == list */ - try_s((ret = cache_list_copy(&file_in, &file_out)), out); + try_s((ret = stream_copy_range(&file_in, &file_out)), out); } break; case mode_generate: @@ -204,15 +204,11 @@ static int load_io_functions(struct settings const * const s, struct stream * co if (s->format == array) { in->get = cached_get_array; in->put = cached_put_array; - in->split = cache_split; - in->rewind = cache_rewind; in->copy = cache_block_copy; } else { /* if (s->format == list */ in->get = cached_get_list; in->put = cached_put_list; - in->split = cache_split; - in->rewind = cache_rewind; - in->copy = cache_list_copy; + in->copy = stream_copy_range; } } } else { |