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

Function is_linear_scan_name

internal/cbm/cbm.c:1071–1076  ·  view source on GitHub ↗

Linear-scan / membership calls: a hit inside a loop is the textbook hidden O(n^2) (cf. Olivo et al., PLDI'15) that syntactic loop-depth alone misses.

Source from the content-addressed store, hash-verified

1069// Linear-scan / membership calls: a hit inside a loop is the textbook hidden
1070// O(n^2) (cf. Olivo et al., PLDI'15) that syntactic loop-depth alone misses.
1071static bool is_linear_scan_name(const char *n) {
1072 static const char *const set[] = {"find", "indexof", "contains", "includes", "search",
1073 "lookup", "strstr", "strchr", "strrchr", "memchr",
1074 "find_if", "findindex", "count", "index", NULL};
1075 return name_in_set(n, set);
1076}
1077
1078// Allocation / growable-append calls: repeated inside a loop is the classic
1079// accidental reallocation / string-concat O(n^2). Names are deliberately

Callers 1

extract_file_ex_bodyFunction · 0.85

Calls 1

name_in_setFunction · 0.85

Tested by

no test coverage detected