Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Kelley <phkelley@hotmail.com>2013-01-27 23:17:07 +0400
committerPhilip Kelley <phkelley@hotmail.com>2013-01-27 23:17:07 +0400
commit11d9f6b30438a141def883b0115f7f764c03e990 (patch)
treeabe54e8085c4e3a1c7a822ee256f81e0d58e6b42 /src/pack.c
parentaa3bf89df21c44f22fe70b4aac9109646fd06b48 (diff)
Vector improvements and their fallout
Diffstat (limited to 'src/pack.c')
-rw-r--r--src/pack.c5
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;
}