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

Function BitwiseAndToBsonValue

pg_documentdb_core/src/io/pgbson_utils.c:290–305  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

288 * Bitwise AND the number stored in number to state and modifies state.
289 */
290void
291BitwiseAndToBsonValue(bson_value_t *state, const bson_value_t *number)
292{
293 if (state->value_type == BSON_TYPE_INT64 || number->value_type == BSON_TYPE_INT64)
294 {
295 int64_t result = BsonValueAsInt64(state) & BsonValueAsInt64(number);
296 state->value.v_int64 = result;
297 state->value_type = BSON_TYPE_INT64;
298 }
299 else
300 {
301 int32_t result = state->value.v_int32 & number->value.v_int32;
302 state->value.v_int32 = result;
303 state->value_type = BSON_TYPE_INT32;
304 }
305}
306
307
308/*

Callers 1

HandleUpdateDollarBitFunction · 0.85

Calls 1

BsonValueAsInt64Function · 0.85

Tested by

no test coverage detected