MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / dk_hub_dockerfiles

Function dk_hub_dockerfiles

src/pipeline/pass_docker.c:1941–1955  ·  view source on GitHub ↗

The number of distinct Dockerfiles the build edges target. */

Source from the content-addressed store, hash-verified

1939
1940/* The number of distinct Dockerfiles the build edges target. */
1941static 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. */

Callers 1

dk_hub_repoFunction · 0.85

Calls 5

cbm_ht_createFunction · 0.85
cbm_ht_hasFunction · 0.85
cbm_ht_setFunction · 0.85
cbm_ht_freeFunction · 0.85
cbm_arena_sprintfFunction · 0.50

Tested by

no test coverage detected