MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / RM_SaveDouble

Function RM_SaveDouble

src/module.cpp:4889–4903  ·  view source on GitHub ↗

In the context of the rdb_save method of a module data type, saves a double * value to the RDB file. The double can be a valid number, a NaN or infinity. * It is possible to load back the value with RedisModule_LoadDouble(). */

Source from the content-addressed store, hash-verified

4887 * value to the RDB file. The double can be a valid number, a NaN or infinity.
4888 * It is possible to load back the value with RedisModule_LoadDouble(). */
4889void RM_SaveDouble(RedisModuleIO *io, double value) {
4890 if (io->error) return;
4891 /* Save opcode. */
4892 int retval = rdbSaveLen(io->prio, RDB_MODULE_OPCODE_DOUBLE);
4893 if (retval == -1) goto saveerr;
4894 io->bytes += retval;
4895 /* Save value. */
4896 retval = rdbSaveBinaryDoubleValue(io->prio, value);
4897 if (retval == -1) goto saveerr;
4898 io->bytes += retval;
4899 return;
4900
4901saveerr:
4902 io->error = 1;
4903}
4904
4905/* In the context of the rdb_save method of a module data type, loads back the
4906 * double value saved by RedisModule_SaveDouble(). */

Callers

nothing calls this directly

Calls 2

rdbSaveLenFunction · 0.85
rdbSaveBinaryDoubleValueFunction · 0.85

Tested by

no test coverage detected