All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Thiago Farina <tfransosi@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH 2/3] bisect: refactor sha1_array into a generic sha1 list
Date: Fri, 20 May 2011 10:14:12 -0700	[thread overview]
Message-ID: <7vy6212t23.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20110520074714.GC3663@sigill.intra.peff.net> (Jeff King's message of "Fri, 20 May 2011 03:47:14 -0400")

Jeff King <peff@peff.net> writes:

> Yeah, they probably should both be unsigned, and the sorted flag should
> be a bit-field (not that it saves any space here, but it makes its purpose
> more clear).
>
> Junio, do you mind squashing this into patch 2/3?

I actually do ;-) If you grep for ALLOC_GROW and look at the structures
they touch, nr/alloc pairs that are integers are the majority in our
codebase, and I do not see much bikeshedding value in adding more unsigned
ones to the mix.

> diff --git a/sha1-array.h b/sha1-array.h
> index 15d3b6b..b602303 100644
> --- a/sha1-array.h
> +++ b/sha1-array.h
> @@ -3,9 +3,9 @@
>  
>  struct sha1_array {
>  	unsigned char (*sha1)[20];
> -	int nr;
> -	int alloc;
> -	int sorted;
> +	unsigned nr;
> +	unsigned alloc;
> +	unsigned sorted:1;
>  };
>  
>  #define SHA1_ARRAY_INIT { NULL, 0, 0, 0 }
>
> -Peff

  reply	other threads:[~2011-05-20 17:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-19 21:32 [PATCH 0/3] avoid duplicate .have lines Jeff King
2011-05-19 21:33 ` [PATCH 1/3] refactor refs_from_alternate_cb to allow passing extra data Jeff King
2011-05-19 21:34 ` [PATCH 2/3] bisect: refactor sha1_array into a generic sha1 list Jeff King
2011-05-20  0:17   ` Thiago Farina
2011-05-20  7:47     ` Jeff King
2011-05-20 17:14       ` Junio C Hamano [this message]
2011-05-23 21:53         ` Jeff King
2011-05-19 21:34 ` [PATCH 3/3] receive-pack: eliminate duplicate .have refs Jeff King
2011-05-20  3:06   ` Junio C Hamano
2011-05-20  7:42     ` Jeff King
2011-05-20 17:06       ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vy6212t23.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=tfransosi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.