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

Function rb_add_row_capped

src/cypher/cypher.c:3152–3164  ·  view source on GitHub ↗

Add one projected row under a row cap, de-duplicating when DISTINCT. * Returns false once a NEW row arrives with the cap already full: the caller * stops there, and flags truncation when the cap is the engine budget. A * duplicate past the cap is neither kept nor evidence of truncation. */

Source from the content-addressed store, hash-verified

3150 * stops there, and flags truncation when the cap is the engine budget. A
3151 * duplicate past the cap is neither kept nor evidence of truncation. */
3152static bool rb_add_row_capped(result_builder_t *rb, rb_distinct_t *d, const char **vals, int cap) {
3153 char *key = NULL;
3154 if (!rb_distinct_is_new(d, vals, rb->col_count, &key)) {
3155 return true;
3156 }
3157 if (rb->row_count >= cap) {
3158 cbm_free(CBM_MEM_CLASS_OTHER, key);
3159 return false;
3160 }
3161 rb_distinct_keep(d, key);
3162 rb_add_row(rb, vals);
3163 return true;
3164}
3165
3166/* ── Main execution ─────────────────────────────────────────────── */
3167

Callers 1

ret_sink_feed_rowsFunction · 0.85

Calls 4

rb_distinct_is_newFunction · 0.85
cbm_freeFunction · 0.85
rb_distinct_keepFunction · 0.85
rb_add_rowFunction · 0.85

Tested by

no test coverage detected