* Compares 2 pgbson objects which may be null. */
| 315 | * Compares 2 pgbson objects which may be null. |
| 316 | */ |
| 317 | int |
| 318 | CompareNullablePgbson(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 | |
| 339 | int |
no test coverage detected