In the context of the rdb_save method of a module data type, loads back the * double value saved by RedisModule_SaveDouble(). */
| 4905 | /* In the context of the rdb_save method of a module data type, loads back the |
| 4906 | * double value saved by RedisModule_SaveDouble(). */ |
| 4907 | double RM_LoadDouble(RedisModuleIO *io) { |
| 4908 | int retval; |
| 4909 | if (io->error) return 0; |
| 4910 | if (io->ver == 2) { |
| 4911 | uint64_t opcode = rdbLoadLen(io->prio,NULL); |
| 4912 | if (opcode != RDB_MODULE_OPCODE_DOUBLE) goto loaderr; |
| 4913 | } |
| 4914 | double value; |
| 4915 | retval = rdbLoadBinaryDoubleValue(io->prio, &value); |
| 4916 | if (retval == -1) goto loaderr; |
| 4917 | return value; |
| 4918 | |
| 4919 | loaderr: |
| 4920 | moduleRDBLoadError(io); |
| 4921 | return 0; |
| 4922 | } |
| 4923 | |
| 4924 | /* In the context of the rdb_save method of a module data type, saves a float |
| 4925 | * value to the RDB file. The float can be a valid number, a NaN or infinity. |
nothing calls this directly
no test coverage detected