diff options
author | Philip Kelley <phkelley@hotmail.com> | 2013-01-27 23:17:07 +0400 |
---|---|---|
committer | Philip Kelley <phkelley@hotmail.com> | 2013-01-27 23:17:07 +0400 |
commit | 11d9f6b30438a141def883b0115f7f764c03e990 (patch) | |
tree | abe54e8085c4e3a1c7a822ee256f81e0d58e6b42 /src/pack.c | |
parent | aa3bf89df21c44f22fe70b4aac9109646fd06b48 (diff) |
Vector improvements and their fallout
Diffstat (limited to 'src/pack.c')
-rw-r--r-- | src/pack.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/pack.c b/src/pack.c index e19fc4bf3..f36f3cf6b 100644 --- a/src/pack.c +++ b/src/pack.c @@ -760,12 +760,11 @@ git_off_t get_delta_base( } else if (type == GIT_OBJ_REF_DELTA) { /* If we have the cooperative cache, search in it first */ if (p->has_cache) { - int pos; + size_t pos; struct git_pack_entry key; git_oid_fromraw(&key.sha1, base_info); - pos = git_vector_bsearch(&p->cache, &key); - if (pos >= 0) { + if (!git_vector_bsearch(&pos, &p->cache, &key)) { *curpos += 20; return ((struct git_pack_entry *)git_vector_get(&p->cache, pos))->offset; } |