summaryrefslogtreecommitdiff
path: root/src/odb_mempack.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2017-01-25 14:11:42 +0100
committerPatrick Steinhardt <ps@pks.im>2017-02-17 11:41:06 +0100
commit036daa59e94bbe1a14ccd8fa018618393a0c62fb (patch)
tree3489354e8437b00f4dbe7ef1809457b53bdf25db /src/odb_mempack.c
parent9694d9ba794b36ebc9fc186c43464a08c2f84c4d (diff)
downloadlibgit2-036daa59e94bbe1a14ccd8fa018618393a0c62fb.tar.gz
khash: use `git_map_exists` where applicable
Diffstat (limited to 'src/odb_mempack.c')
-rw-r--r--src/odb_mempack.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/odb_mempack.c b/src/odb_mempack.c
index b9bdf0bb5..6aa9ad89a 100644
--- a/src/odb_mempack.c
+++ b/src/odb_mempack.c
@@ -72,13 +72,8 @@ static int impl__write(git_odb_backend *_backend, const git_oid *oid, const void
static int impl__exists(git_odb_backend *backend, const git_oid *oid)
{
struct memory_packer_db *db = (struct memory_packer_db *)backend;
- khiter_t pos;
-
- pos = kh_get(oid, db->objects, oid);
- if (pos != kh_end(db->objects))
- return 1;
- return 0;
+ return git_oidmap_exists(db->objects, oid);
}
static int impl__read(void **buffer_p, size_t *len_p, git_otype *type_p, git_odb_backend *backend, const git_oid *oid)