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

Function BitwiseOrToBsonValue

pg_documentdb_core/src/io/pgbson_utils.c:311–326  ·  view source on GitHub ↗

* Bitwise OR the number stored in number to state and modifies state. */

Source from the content-addressed store, hash-verified

309 * Bitwise OR the number stored in number to state and modifies state.
310 */
311void
312BitwiseOrToBsonValue(bson_value_t *state, const bson_value_t *number)
313{
314 if (state->value_type == BSON_TYPE_INT64 || number->value_type == BSON_TYPE_INT64)
315 {
316 int64_t result = BsonValueAsInt64(state) | BsonValueAsInt64(number);
317 state->value.v_int64 = result;
318 state->value_type = BSON_TYPE_INT64;
319 }
320 else
321 {
322 int32_t result = state->value.v_int32 | number->value.v_int32;
323 state->value.v_int32 = result;
324 state->value_type = BSON_TYPE_INT32;
325 }
326}
327
328
329/*

Callers 1

HandleUpdateDollarBitFunction · 0.85

Calls 1

BsonValueAsInt64Function · 0.85

Tested by

no test coverage detected