const uint32_t *level1_ofs = p->index_data;
const unsigned char *index = p->index_data;
unsigned stride;
- int ret;
+ uint32_t result;
if (!index) {
if (open_pack_index(p))
index += 4;
}
- ret = bsearch_hash(sha1, level1_ofs, index, stride);
- if (ret >= 0)
- return nth_packed_object_offset(p, ret);
+ if (bsearch_hash(sha1, level1_ofs, index, stride, &result))
+ return nth_packed_object_offset(p, result);
return 0;
}