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

Function PgbsonWriterAppendInt32OrDouble

pg_documentdb_core/src/io/pgbson.c:917–929  ·  view source on GitHub ↗

* Appends the given value as an int32 or double if the former would result in overflow. */

Source from the content-addressed store, hash-verified

915 * Appends the given value as an int32 or double if the former would result in overflow.
916 */
917void
918PgbsonWriterAppendInt32OrDouble(pgbson_writer *writer, const char *path, uint32_t
919 pathLength, int64 value)
920{
921 if (value >= INT32_MIN && value <= INT32_MAX)
922 {
923 PgbsonWriterAppendInt32(writer, path, pathLength, (int) value);
924 }
925 else
926 {
927 PgbsonWriterAppendDouble(writer, path, pathLength, value);
928 }
929}
930
931
932/*

Callers 2

WriteCoreStorageStatsFunction · 0.85
command_kill_opFunction · 0.85

Calls 2

PgbsonWriterAppendInt32Function · 0.85
PgbsonWriterAppendDoubleFunction · 0.85

Tested by

no test coverage detected