MCPcopy Index your code
hub / github.com/git/git / find_bitmap_for_commit

Function find_bitmap_for_commit

pack-bitmap.c:1020–1048  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1018}
1019
1020static struct ewah_bitmap *find_bitmap_for_commit(struct bitmap_index *bitmap_git,
1021 struct commit *commit,
1022 struct bitmap_index **found)
1023{
1024 khiter_t hash_pos;
1025 if (!bitmap_git)
1026 return NULL;
1027
1028 hash_pos = kh_get_oid_map(bitmap_git->bitmaps, commit->object.oid);
1029 if (hash_pos >= kh_end(bitmap_git->bitmaps)) {
1030 struct stored_bitmap *bitmap = NULL;
1031 if (!bitmap_git->table_lookup)
1032 return find_bitmap_for_commit(bitmap_git->base, commit,
1033 found);
1034
1035 /* this is a fairly hot codepath - no trace2_region please */
1036 /* NEEDSWORK: cache misses aren't recorded */
1037 bitmap = lazy_bitmap_for_commit(bitmap_git, commit);
1038 if (!bitmap)
1039 return find_bitmap_for_commit(bitmap_git->base, commit,
1040 found);
1041 if (found)
1042 *found = bitmap_git;
1043 return lookup_stored_bitmap(bitmap);
1044 }
1045 if (found)
1046 *found = bitmap_git;
1047 return lookup_stored_bitmap(kh_value(bitmap_git->bitmaps, hash_pos));
1048}
1049
1050struct ewah_bitmap *bitmap_for_commit(struct bitmap_index *bitmap_git,
1051 struct commit *commit)

Callers 2

bitmap_for_commitFunction · 0.85
test_bitmap_walkFunction · 0.85

Calls 2

lazy_bitmap_for_commitFunction · 0.85
lookup_stored_bitmapFunction · 0.85

Tested by 1

test_bitmap_walkFunction · 0.68