MCPcopy Create free account
hub / github.com/F-Stack/f-stack / RM_LoadFloat

Function RM_LoadFloat

app/redis-6.2.6/src/module.c:4837–4851  ·  view source on GitHub ↗

In the context of the rdb_save method of a module data type, loads back the * float value saved by RedisModule_SaveFloat(). */

Source from the content-addressed store, hash-verified

4835/* In the context of the rdb_save method of a module data type, loads back the
4836 * float value saved by RedisModule_SaveFloat(). */
4837float RM_LoadFloat(RedisModuleIO *io) {
4838 if (io->error) return 0;
4839 if (io->ver == 2) {
4840 uint64_t opcode = rdbLoadLen(io->rio,NULL);
4841 if (opcode != RDB_MODULE_OPCODE_FLOAT) goto loaderr;
4842 }
4843 float value;
4844 int retval = rdbLoadBinaryFloatValue(io->rio, &value);
4845 if (retval == -1) goto loaderr;
4846 return value;
4847
4848loaderr:
4849 moduleRDBLoadError(io);
4850 return 0;
4851}
4852
4853/* In the context of the rdb_save method of a module data type, saves a long double
4854 * value to the RDB file. The double can be a valid number, a NaN or infinity.

Callers

nothing calls this directly

Calls 3

rdbLoadLenFunction · 0.85
rdbLoadBinaryFloatValueFunction · 0.85
moduleRDBLoadErrorFunction · 0.85

Tested by

no test coverage detected