This is just a wrapper for lpReplace() to directly use a 64 bit integer * instead of a string to replace the current element. The function returns * the new listpack as return value, and also updates the current cursor * by updating '*pos'. */
| 260 | * the new listpack as return value, and also updates the current cursor |
| 261 | * by updating '*pos'. */ |
| 262 | unsigned char *lpReplaceInteger(unsigned char *lp, unsigned char **pos, int64_t value) { |
| 263 | char buf[LONG_STR_SIZE]; |
| 264 | int slen = ll2string(buf,sizeof(buf),value); |
| 265 | return lpInsert(lp, (unsigned char*)buf, slen, *pos, LP_REPLACE, pos); |
| 266 | } |
| 267 | |
| 268 | /* This is a wrapper function for lpGet() to directly get an integer value |
| 269 | * from the listpack (that may store numbers as a string), converting |
no test coverage detected