| 253 | } |
| 254 | |
| 255 | static int find_cached_object_pos(struct bitmap_writer *writer, |
| 256 | const struct object_id *oid, uint32_t *pos) |
| 257 | { |
| 258 | size_t slot = bitmap_writer_pos_cache_slot(writer, oid); |
| 259 | |
| 260 | if (bitmap_writer_pos_cache_valid(writer, slot) && |
| 261 | oideq(&writer->pos_cache[slot].oid, oid)) { |
| 262 | writer->pos_cache_hits++; |
| 263 | *pos = writer->pos_cache[slot].pos & ~BITMAP_POS_CACHE_VALID; |
| 264 | return 1; |
| 265 | } |
| 266 | |
| 267 | writer->pos_cache_misses++; |
| 268 | return 0; |
| 269 | } |
| 270 | |
| 271 | static uint32_t store_cached_object_pos(struct bitmap_writer *writer, |
| 272 | const struct object_id *oid, |
no test coverage detected