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

Function RM_SaveFloat

src/module.cpp:4927–4941  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

4925 * value to the RDB file. The float can be a valid number, a NaN or infinity.
4926 * It is possible to load back the value with RedisModule_LoadFloat(). */
4927void RM_SaveFloat(RedisModuleIO *io, float value) {
4928 if (io->error) return;
4929 /* Save opcode. */
4930 int retval = rdbSaveLen(io->prio, RDB_MODULE_OPCODE_FLOAT);
4931 if (retval == -1) goto saveerr;
4932 io->bytes += retval;
4933 /* Save value. */
4934 retval = rdbSaveBinaryFloatValue(io->prio, value);
4935 if (retval == -1) goto saveerr;
4936 io->bytes += retval;
4937 return;
4938
4939saveerr:
4940 io->error = 1;
4941}
4942
4943/* In the context of the rdb_save method of a module data type, loads back the
4944 * float value saved by RedisModule_SaveFloat(). */

Callers

nothing calls this directly

Calls 2

rdbSaveLenFunction · 0.85
rdbSaveBinaryFloatValueFunction · 0.85

Tested by

no test coverage detected