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

Function RM_LoadDouble

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

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

Source from the content-addressed store, hash-verified

4798/* In the context of the rdb_save method of a module data type, loads back the
4799 * double value saved by RedisModule_SaveDouble(). */
4800double RM_LoadDouble(RedisModuleIO *io) {
4801 if (io->error) return 0;
4802 if (io->ver == 2) {
4803 uint64_t opcode = rdbLoadLen(io->rio,NULL);
4804 if (opcode != RDB_MODULE_OPCODE_DOUBLE) goto loaderr;
4805 }
4806 double value;
4807 int retval = rdbLoadBinaryDoubleValue(io->rio, &value);
4808 if (retval == -1) goto loaderr;
4809 return value;
4810
4811loaderr:
4812 moduleRDBLoadError(io);
4813 return 0;
4814}
4815
4816/* In the context of the rdb_save method of a module data type, saves a float
4817 * value to the RDB file. The float can be a valid number, a NaN or infinity.

Callers

nothing calls this directly

Calls 3

rdbLoadLenFunction · 0.85
rdbLoadBinaryDoubleValueFunction · 0.85
moduleRDBLoadErrorFunction · 0.85

Tested by

no test coverage detected