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

Function text_matches_candidate

src/cli/config_text_edit.c:1265–1275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1263}
1264
1265static int text_matches_candidate(const char *data, size_t data_len, const char *candidate,
1266 bool *matches) {
1267 size_t candidate_len = 0U;
1268 if (!matches || text_bounded_strlen(candidate, TEXT_MAX_BYTES, &candidate_len) != TEXT_OK ||
1269 text_validate_bytes(candidate, candidate_len, 1) != TEXT_OK) {
1270 return TEXT_ERROR;
1271 }
1272 *matches =
1273 data_len == candidate_len && (data_len == 0U || memcmp(data, candidate, data_len) == 0);
1274 return TEXT_OK;
1275}
1276
1277/* Read-only classification: WOULD a migrate of this document succeed?
1278 * Returns TEXT_OK when the path is absent or already byte-identical to the

Calls 2

text_bounded_strlenFunction · 0.85
text_validate_bytesFunction · 0.85

Tested by

no test coverage detected