Re: [RFC/PATCH 2/3] replace_object: add mechanism to replace objects found in "refs/replace/"
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jan 7, 2009, 12:29 UTC
- Message-ID
- <alpine.DEB.1.00.0901071327481.7496@intel-tinevez-2-302>
- In-Reply-To
- <20090107084341.1554d8cd.chriscool@tuxfamily.org>
Hi,
On Wed, 7 Jan 2009, Christian Couder wrote:
Show 22 quoted lines
> diff --git a/replace_object.c b/replace_object.c
> new file mode 100644
> index 0000000..b50890d
> --- /dev/null
> +++ b/replace_object.c
> @@ -0,0 +1,102 @@
> +#include "cache.h"
> +#include "refs.h"
> +
> +static struct replace_object {
> + unsigned char sha1[2][20];
> +} **replace_object;
> +
> +static int replace_object_alloc, replace_object_nr;
> +
> +static int replace_object_pos(const unsigned char *sha1)
> +{
> + int lo, hi;
> + lo = 0;
> + hi = replace_object_nr;
> + while (lo < hi) {
> [...]I suspect that this sorted list should be a hashmap.
Ciao, Dscho