| 29 | } |
| 30 | |
| 31 | static int insert_oid_pair(kh_oid_map_t *map, const struct object_id *key, const struct object_id *value) |
| 32 | { |
| 33 | khiter_t pos; |
| 34 | int ret; |
| 35 | struct object_id *stored; |
| 36 | |
| 37 | pos = kh_put_oid_map(map, *key, &ret); |
| 38 | |
| 39 | /* This item already exists in the map. */ |
| 40 | if (ret == 0) |
| 41 | return 0; |
| 42 | |
| 43 | stored = xmalloc(sizeof(*stored)); |
| 44 | oidcpy(stored, value); |
| 45 | kh_value(map, pos) = stored; |
| 46 | return 1; |
| 47 | } |
| 48 | |
| 49 | static int insert_loose_map(struct odb_source_loose *loose, |
| 50 | const struct object_id *oid, |
no test coverage detected