From 8fbb558af4e911a9507295809a4d1d7d6687b6e1 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Thu, 20 Jun 2019 03:41:28 -0400 Subject: khash: rename kh_oid_t to kh_oid_set khash lets us define a hash as either a map or a set (i.e., with no "value" type). For the oid maps we define, "oid" is the set and "oid_map" is the map. As the bug in the previous commit shows, it's easy to pick the wrong one. So let's make the names more distinct: "oid_set" and "oid_map". An alternative naming scheme would be to actually name the type after the key/value types. So e.g., "oid" _would_ be the set, since it has no value type. And "oid_map" would become "oid_void" or similar (and "oid_pos" becomes "oid_int"). That's better in some ways: it's more regular, and a given map type can be more reasily reused in multiple contexts (e.g., something storing an "int" that isn't a "pos"). But it's also slightly less descriptive. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- oidset.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'oidset.h') diff --git a/oidset.h b/oidset.h index 14f18f791f..505fad578b 100644 --- a/oidset.h +++ b/oidset.h @@ -20,7 +20,7 @@ * A single oidset; should be zero-initialized (or use OIDSET_INIT). */ struct oidset { - kh_oid_t set; + kh_oid_set_t set; }; #define OIDSET_INIT { { 0 } } @@ -62,7 +62,7 @@ int oidset_remove(struct oidset *set, const struct object_id *oid); void oidset_clear(struct oidset *set); struct oidset_iter { - kh_oid_t *set; + kh_oid_set_t *set; khiter_t iter; }; -- cgit v1.2.3