The number of distinct Dockerfiles the build edges target. */
| 1939 | |
| 1940 | /* The number of distinct Dockerfiles the build edges target. */ |
| 1941 | static int dk_hub_dockerfiles(CBMArena *a, const dk_hub_edges_t *b) { |
| 1942 | CBMHashTable *seen = cbm_ht_create(0); |
| 1943 | int n = 0; |
| 1944 | for (int i = 0; seen && i < b->n; i++) { |
| 1945 | const char *k = cbm_arena_sprintf(a, "%lld", (long long)b->v[i].tgt); |
| 1946 | if (k && !cbm_ht_has(seen, k)) { |
| 1947 | cbm_ht_set(seen, k, (void *)SKIP_ONE); |
| 1948 | n++; |
| 1949 | } |
| 1950 | } |
| 1951 | if (seen) { |
| 1952 | cbm_ht_free(seen); |
| 1953 | } |
| 1954 | return n; |
| 1955 | } |
| 1956 | |
| 1957 | /* The common prefix / suffix of the build tags, cut back to a separator and |
| 1958 | * leaving every tag a non-empty middle where it can: *pre, *suf. */ |
no test coverage detected