* Validate if the pgbson is an empty document. * Note that the bson spec (https://bsonspec.org/spec.html) implies that an array has * 4 bytes for the array length, followed by a list of [ 1 byte type code, path, value] * This implies that a non empty array has 4 bytes of length, 1 byte of type code * (for the first element), and at least 1 byte for the index path which is 6 bytes at least. */
| 128 | * (for the first element), and at least 1 byte for the index path which is 6 bytes at least. |
| 129 | */ |
| 130 | inline static bool |
| 131 | IsPgbsonEmptyDocument(const pgbson *value) |
| 132 | { |
| 133 | return value != NULL && VARSIZE_ANY_EXHDR(value) < 6; |
| 134 | } |
| 135 | |
| 136 | |
| 137 | /* |
no outgoing calls
no test coverage detected