| 409 | } |
| 410 | |
| 411 | bool redis_hash::hincrby(const char* key, const char* name, |
| 412 | long long int inc, long long int* result /* = NULL */) |
| 413 | { |
| 414 | const char* names[1]; |
| 415 | |
| 416 | names[0] = name; |
| 417 | char buf[INT64_LEN]; |
| 418 | (void) acl_i64toa(inc, buf, sizeof(buf)); |
| 419 | const char* values[1]; |
| 420 | values[0] = buf; |
| 421 | |
| 422 | hash_slot(key); |
| 423 | build("HINCRBY", key, names, values, 1); |
| 424 | |
| 425 | bool success; |
| 426 | |
| 427 | if (result != NULL) { |
| 428 | *result = get_number64(&success); |
| 429 | } else { |
| 430 | (void) get_number64(&success); |
| 431 | } |
| 432 | |
| 433 | return success; |
| 434 | } |
| 435 | |
| 436 | bool redis_hash::hincrbyfloat(const char* key, const char* name, |
| 437 | double inc, double* result /* = NULL */) |