In the context of the rdb_save method of a module data type, loads back the * double value saved by RedisModule_SaveDouble(). */
| 4798 | /* In the context of the rdb_save method of a module data type, loads back the |
| 4799 | * double value saved by RedisModule_SaveDouble(). */ |
| 4800 | double 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 | |
| 4811 | loaderr: |
| 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. |
nothing calls this directly
no test coverage detected