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

Function imp_value

tests/test_importance.c:47–56  ·  view source on GitHub ↗

Parse the numeric value of "importance" out of a properties_json blob. * Returns a sentinel (-999.0) when the key is absent — callers that care about * presence assert on imp_key_count() instead. */

Source from the content-addressed store, hash-verified

45 * Returns a sentinel (-999.0) when the key is absent — callers that care about
46 * presence assert on imp_key_count() instead. */
47static double imp_value(const char *json) {
48 if (!json) {
49 return -999.0;
50 }
51 const char *p = strstr(json, "\"importance\":");
52 if (!p) {
53 return -999.0;
54 }
55 return strtod(p + strlen("\"importance\":"), NULL);
56}
57
58/* How many times the key appears. The duplicate-key corruption this suite
59 * guards against shows up here as 2. */

Callers 2

imp_collect_scoresFunction · 0.85
test_importance.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected