From: Michal Schmidt Date: Wed, 17 Dec 2014 14:37:52 +0000 (+0100) Subject: journal: drop unnecessary parameters of next_beyond_location() X-Git-Tag: v219~939 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=58439db4cc45a6f84a74ad73f873bd3c113eebf6;ds=sidebyside journal: drop unnecessary parameters of next_beyond_location() offset is redundant, because the caller can rely on f->current_offset. The object pointer the function saves in *ret is thrown away by the caller. --- diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c index 8cf6de651..f3aae9b0e 100644 --- a/src/journal/sd-journal.c +++ b/src/journal/sd-journal.c @@ -727,7 +727,7 @@ static int next_with_matches( return next_for_match(j, j->level0, f, direction == DIRECTION_DOWN ? cp+1 : cp-1, direction, ret, offset); } -static int next_beyond_location(sd_journal *j, JournalFile *f, direction_t direction, Object **ret, uint64_t *offset) { +static int next_beyond_location(sd_journal *j, JournalFile *f, direction_t direction) { Object *c; uint64_t cp; int r; @@ -771,11 +771,6 @@ static int next_beyond_location(sd_journal *j, JournalFile *f, direction_t direc if (found) { journal_file_save_location(f, direction, c, cp); - - if (ret) - *ret = c; - if (offset) - *offset = cp; return 1; } @@ -787,7 +782,6 @@ static int next_beyond_location(sd_journal *j, JournalFile *f, direction_t direc static int real_journal_next(sd_journal *j, direction_t direction) { JournalFile *f, *new_file = NULL; - uint64_t p = 0; Iterator i; Object *o; int r; @@ -798,7 +792,7 @@ static int real_journal_next(sd_journal *j, direction_t direction) { ORDERED_HASHMAP_FOREACH(f, j->files, i) { bool found; - r = next_beyond_location(j, f, direction, &o, &p); + r = next_beyond_location(j, f, direction); if (r < 0) { log_debug_errno(r, "Can't iterate through %s, ignoring: %m", f->path); remove_file_real(j, f);