Merge branch 'po/git-help-on-git-itself'
[gitweb.git] / oidset.h
index 4b90540cd40eaffa9b1635f52731694ad28a29da..14f18f791fea19301a41b650b860b0b432241e7a 100644 (file)
--- a/oidset.h
+++ b/oidset.h
  *      table overhead.
  */
 
-static inline unsigned int oid_hash(struct object_id oid)
-{
-       return sha1hash(oid.hash);
-}
-
-static inline int oid_equal(struct object_id a, struct object_id b)
-{
-       return oideq(&a, &b);
-}
-
-KHASH_INIT(oid, struct object_id, int, 0, oid_hash, oid_equal)
-
 /**
  * A single oidset; should be zero-initialized (or use OIDSET_INIT).
  */
@@ -38,12 +26,13 @@ struct oidset {
 #define OIDSET_INIT { { 0 } }
 
 
-static inline void oidset_init(struct oidset *set, size_t initial_size)
-{
-       memset(&set->set, 0, sizeof(set->set));
-       if (initial_size)
-               kh_resize_oid(&set->set, initial_size);
-}
+/**
+ * Initialize the oidset structure `set`.
+ *
+ * If `initial_size` is bigger than 0 then preallocate to allow inserting
+ * the specified number of elements without further allocations.
+ */
+void oidset_init(struct oidset *set, size_t initial_size);
 
 /**
  * Returns true iff `set` contains `oid`.