[PATCH 5/6] reftable: drop unused parameter from reader_seek_linear()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The reader code passes around a "struct reftable_reader" context
variable. But the seek function doesn't need it; the table iterator we
already get is sufficient.

Signed-off-by: Jeff King <peff@xxxxxxxx>
---
One could argue that this is a method of a reftable_reader following the
usual C object-oriented naming conventions, and thus should retain its
first parameter, even if it isn't directly used.

In that case, we can annotate this as unused (once we have the ability
to do so, which will be a separate series). I have a mild preference for
removing it (hence this patch), since I think that makes the code more
clear. I suppose one could also argue that it should be a method of the
table_iter: table_iter_seek_linear() or something. I don't think it
matters much, and my ulterior motive is appeasing -Wunused-parameters.

 reftable/reader.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/reftable/reader.c b/reftable/reader.c
index 54b4025105..b4db23ce18 100644
--- a/reftable/reader.c
+++ b/reftable/reader.c
@@ -443,7 +443,7 @@ static int reader_start(struct reftable_reader *r, struct table_iter *ti,
 	return reader_table_iter_at(r, ti, off, typ);
 }
 
-static int reader_seek_linear(struct reftable_reader *r, struct table_iter *ti,
+static int reader_seek_linear(struct table_iter *ti,
 			      struct reftable_record *want)
 {
 	struct reftable_record rec =
@@ -510,7 +510,7 @@ static int reader_seek_indexed(struct reftable_reader *r,
 	if (err < 0)
 		goto done;
 
-	err = reader_seek_linear(r, &index_iter, &want_index);
+	err = reader_seek_linear(&index_iter, &want_index);
 	while (1) {
 		err = table_iter_next(&index_iter, &index_result);
 		table_iter_block_done(&index_iter);
@@ -570,7 +570,7 @@ static int reader_seek_internal(struct reftable_reader *r,
 	err = reader_start(r, &ti, reftable_record_type(rec), 0);
 	if (err < 0)
 		return err;
-	err = reader_seek_linear(r, &ti, rec);
+	err = reader_seek_linear(&ti, rec);
 	if (err < 0)
 		return err;
 	else {
-- 
2.37.2.928.g0821088f4a




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux