From a3a3325a03ef297746c900ca11d4d1d2a950b840 Mon Sep 17 00:00:00 2001 From: Petr Tesarik Date: Sun, 21 Oct 2012 16:43:29 +0200 Subject: [PATCH] cleanup: open-code move_to_next() There is only one place using this function, and since its definition is trivial, it is better to show the code where it is used. --- libhed/file.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/libhed/file.c b/libhed/file.c index e477f39..d479398 100644 --- a/libhed/file.c +++ b/libhed/file.c @@ -1534,19 +1534,6 @@ cursor_next_block(hed_cursor_t *curs) return block; } -/* This is an optimized way of doing: - * - * hed_move_relative(curs, curs->block->t.size); - * - * for the case when curs->off == 0. - */ -static struct hed_block * -move_to_next(hed_cursor_t *curs) -{ - curs->pos += hed_block_size(curs->block); - return cursor_next_block(curs); -} - /* Copy in @count bytes from @pos. * Returns the number of bytes that were not read (i.e. zero on success). * The @pos cursor is moved by the amount of data read. @@ -2165,7 +2152,8 @@ hed_file_commit(struct hed_file *f) } else if (!cc.needwrite) ret |= end_skip(&cc); - if (!move_to_next(&cc.endoff)) + cc.endoff.pos += hed_block_size(cc.endoff.block); + if (!cursor_next_block(&cc.endoff)) break; } assert(cc.endoff.pos == hed_file_size(&file->f)); -- 2.11.4.GIT