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

Function with_order_compare_value

src/cypher/cypher.c:4427–4433  ·  view source on GitHub ↗

One WITH ORDER BY key comparison: numerically when both values start with a * number, else by strcmp; positive = a after b. */

Source from the content-addressed store, hash-verified

4425/* One WITH ORDER BY key comparison: numerically when both values start with a
4426 * number, else by strcmp; positive = a after b. */
4427static int with_order_compare_value(const char *va, const char *vb) {
4428 char *ea = NULL;
4429 char *eb = NULL;
4430 double da = strtod(va, &ea);
4431 double db = strtod(vb, &eb);
4432 return (ea != va && eb != vb) ? ((da > db) - (da < db)) : strcmp(va, vb);
4433}
4434
4435/* The full comparison over the ORDER BY key list: later keys break ties,
4436 * direction is per key (#1334). */

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected