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

Function BitwiseXorToBsonValue

pg_documentdb_core/src/io/pgbson_utils.c:332–347  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

330 * Bitwise XOR the number stored in number to state and modifies state.
331 */
332void
333BitwiseXorToBsonValue(bson_value_t *state, const bson_value_t *number)
334{
335 if (state->value_type == BSON_TYPE_INT64 || number->value_type == BSON_TYPE_INT64)
336 {
337 int64_t result = BsonValueAsInt64(state) ^ BsonValueAsInt64(number);
338 state->value.v_int64 = result;
339 state->value_type = BSON_TYPE_INT64;
340 }
341 else
342 {
343 int32_t result = state->value.v_int32 ^ number->value.v_int32;
344 state->value.v_int32 = result;
345 state->value_type = BSON_TYPE_INT32;
346 }
347}
348
349
350/*

Callers 1

HandleUpdateDollarBitFunction · 0.85

Calls 1

BsonValueAsInt64Function · 0.85

Tested by

no test coverage detected