In the context of the rdb_save method of a module data type, saves a double * value to the RDB file. The double can be a valid number, a NaN or infinity. * It is possible to load back the value with RedisModule_LoadDouble(). */
| 4887 | * value to the RDB file. The double can be a valid number, a NaN or infinity. |
| 4888 | * It is possible to load back the value with RedisModule_LoadDouble(). */ |
| 4889 | void RM_SaveDouble(RedisModuleIO *io, double value) { |
| 4890 | if (io->error) return; |
| 4891 | /* Save opcode. */ |
| 4892 | int retval = rdbSaveLen(io->prio, RDB_MODULE_OPCODE_DOUBLE); |
| 4893 | if (retval == -1) goto saveerr; |
| 4894 | io->bytes += retval; |
| 4895 | /* Save value. */ |
| 4896 | retval = rdbSaveBinaryDoubleValue(io->prio, value); |
| 4897 | if (retval == -1) goto saveerr; |
| 4898 | io->bytes += retval; |
| 4899 | return; |
| 4900 | |
| 4901 | saveerr: |
| 4902 | io->error = 1; |
| 4903 | } |
| 4904 | |
| 4905 | /* In the context of the rdb_save method of a module data type, loads back the |
| 4906 | * double value saved by RedisModule_SaveDouble(). */ |
nothing calls this directly
no test coverage detected