diff mbox series

[01/13] upload-pack: remove unused 'wants' from upload_pack_data

Message ID 20200515100454.14486-2-chriscool@tuxfamily.org (mailing list archive)
State New, archived
Headers show
Series upload-pack: use 'struct upload_pack_data' thoroughly, part 1 | expand

Commit Message

Christian Couder May 15, 2020, 10:04 a.m. UTC
As we cleanup 'upload-pack.c' by using 'struct upload_pack_data'
more thoroughly, let's remove 'struct object_array wants' from
'struct upload_pack_data', as it appears to be unused.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 upload-pack.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Jeff King May 15, 2020, 6:03 p.m. UTC | #1
On Fri, May 15, 2020 at 12:04:42PM +0200, Christian Couder wrote:

> As we cleanup 'upload-pack.c' by using 'struct upload_pack_data'
> more thoroughly, let's remove 'struct object_array wants' from
> 'struct upload_pack_data', as it appears to be unused.

Yep, the diff shows this is clearly not used.

I was a bit curious how it came to be unused, but it was like this from
the very start of that struct being added in 3145ea957d (upload-pack:
introduce fetch server command, 2018-03-15). We don't need it because of
the local want_obj in upload_pack_v2(), but I see you deal with that in
the next commit. Looks good so far.

-Peff
diff mbox series

Patch

diff --git a/upload-pack.c b/upload-pack.c
index 0478bff3e7..9aaf886828 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -1131,7 +1131,6 @@  void upload_pack(struct upload_pack_options *options)
 }
 
 struct upload_pack_data {
-	struct object_array wants;
 	struct string_list wanted_refs;
 	struct oid_array haves;
 
@@ -1157,14 +1156,12 @@  struct upload_pack_data {
 
 static void upload_pack_data_init(struct upload_pack_data *data)
 {
-	struct object_array wants = OBJECT_ARRAY_INIT;
 	struct string_list wanted_refs = STRING_LIST_INIT_DUP;
 	struct oid_array haves = OID_ARRAY_INIT;
 	struct object_array shallows = OBJECT_ARRAY_INIT;
 	struct string_list deepen_not = STRING_LIST_INIT_DUP;
 
 	memset(data, 0, sizeof(*data));
-	data->wants = wants;
 	data->wanted_refs = wanted_refs;
 	data->haves = haves;
 	data->shallows = shallows;
@@ -1174,7 +1171,6 @@  static void upload_pack_data_init(struct upload_pack_data *data)
 
 static void upload_pack_data_clear(struct upload_pack_data *data)
 {
-	object_array_clear(&data->wants);
 	string_list_clear(&data->wanted_refs, 1);
 	oid_array_clear(&data->haves);
 	object_array_clear(&data->shallows);