MCPcopy Create free account
hub / github.com/documentdb/documentdb / CompareNullablePgbson

Function CompareNullablePgbson

pg_documentdb_core/src/query/bson_compare.c:317–336  ·  view source on GitHub ↗

* Compares 2 pgbson objects which may be null. */

Source from the content-addressed store, hash-verified

315 * Compares 2 pgbson objects which may be null.
316 */
317int
318CompareNullablePgbson(pgbson *leftBson, pgbson *rightBson)
319{
320 /* If the bsons are both null or the same pointer, they are equal */
321 if (leftBson == rightBson)
322 {
323 return 0;
324 }
325
326 if (leftBson == NULL)
327 {
328 return -1;
329 }
330 else if (rightBson == NULL)
331 {
332 return 1;
333 }
334
335 return ComparePgbson(leftBson, rightBson);
336}
337
338
339int

Callers 2

BsonOrderTransitionFunction · 0.85
BsonOrderCombineFunction · 0.85

Calls 1

ComparePgbsonFunction · 0.85

Tested by

no test coverage detected