Skip to content

Commit 8ebf529

Browse files
peffgitster
authored andcommitted
pack-bitmap: simplify bitmap_has_oid_in_uninteresting()
Let's refactor bitmap_has_oid_in_uninteresting() using bitmap_walk_contains(). Signed-off-by: Jeff King <[email protected]> Signed-off-by: Christian Couder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 59b2829 commit 8ebf529

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

pack-bitmap.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,16 +1132,6 @@ void free_bitmap_index(struct bitmap_index *b)
11321132
int bitmap_has_oid_in_uninteresting(struct bitmap_index *bitmap_git,
11331133
const struct object_id *oid)
11341134
{
1135-
int pos;
1136-
1137-
if (!bitmap_git)
1138-
return 0; /* no bitmap loaded */
1139-
if (!bitmap_git->haves)
1140-
return 0; /* walk had no "haves" */
1141-
1142-
pos = bitmap_position(bitmap_git, oid);
1143-
if (pos < 0)
1144-
return 0;
1145-
1146-
return bitmap_get(bitmap_git->haves, pos);
1135+
return bitmap_git &&
1136+
bitmap_walk_contains(bitmap_git, bitmap_git->haves, oid);
11471137
}

0 commit comments

Comments
 (0)