MCPcopy Create free account
hub / github.com/acl-dev/acl / hincrby

Method hincrby

lib_acl_cpp/src/redis/redis_hash.cpp:411–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

409}
410
411bool 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
436bool redis_hash::hincrbyfloat(const char* key, const char* name,
437 double inc, double* result /* = NULL */)

Callers 1

test_hincrbyFunction · 0.80

Calls 3

acl_i64toaFunction · 0.85
hash_slotFunction · 0.85
buildFunction · 0.50

Tested by 1

test_hincrbyFunction · 0.64