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

Method sscan

lib_acl_cpp/src/redis/redis_set.cpp:436–463  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

434}
435
436int redis_set::sscan(const char* key, int cursor, std::vector<string>& out,
437 const char* pattern /* = NULL */, const size_t* count /* = NULL */)
438{
439 if (key == NULL || *key == 0 || cursor < 0) {
440 return -1;
441 }
442
443 size_t size;
444 const redis_result** children = scan_keys("SSCAN", key, cursor,
445 size, pattern, count);
446 if (children == NULL) {
447 return cursor;
448 }
449
450 const redis_result* rr;
451 string key_buf(128);
452
453 out.reserve(out.size() + size);
454
455 for (size_t i = 0; i < size; i++) {
456 rr = children[i];
457 rr->argv_to_string(key_buf);
458 out.push_back(key_buf);
459 key_buf.clear();
460 }
461
462 return cursor;
463}
464
465} // namespace acl
466

Callers 1

test_sscanFunction · 0.80

Calls 5

reserveMethod · 0.45
sizeMethod · 0.45
argv_to_stringMethod · 0.45
push_backMethod · 0.45
clearMethod · 0.45

Tested by 1

test_sscanFunction · 0.64