patch-ids: stop using a hand-rolled hashmap implementation

This change will use the hashmap from the hashmap.h to keep track of the
patch_ids that have been encountered instead of using an internal
implementation.  This simplifies the implementation of the patch ids.

Signed-off-by: Kevin Willford <kcwillford@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Kevin Willford
2016-07-29 12:19:17 -04:00
committed by Junio C Hamano
parent 05219a1276
commit dfb7a1b4d0
2 changed files with 32 additions and 61 deletions

View File

@ -2,15 +2,14 @@
#define PATCH_IDS_H
struct patch_id {
unsigned char patch_id[20];
struct hashmap_entry ent;
unsigned char patch_id[GIT_SHA1_RAWSZ];
char seen;
};
struct patch_ids {
struct hashmap patches;
struct diff_options diffopts;
int nr, alloc;
struct patch_id **table;
struct patch_id_bucket *patches;
};
int commit_patch_id(struct commit *commit, struct diff_options *options,