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

Method result_value

lib_acl_cpp/src/redis/redis_command.cpp:364–390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362}
363
364const char* redis_command::result_value(size_t i, size_t* len /* = NULL */) const
365{
366 if (result_ == NULL || result_->get_type() != REDIS_RESULT_ARRAY) {
367 return NULL;
368 }
369 const redis_result* child = result_->get_child(i);
370 if (child == NULL) {
371 return NULL;
372 }
373 size_t size = child->get_size();
374 if (size == 0) {
375 return NULL;
376 }
377 if (size == 1) {
378 return child->get(0, len);
379 }
380
381 // ���ڴ��п��ܱ���Ƭ�ɶ����������С�ڴ�
382 size = child->get_length();
383 size++;
384 char* buf = (char*) dbuf_->dbuf_alloc(size);
385 size = child->argv_to_string(buf, size);
386 if (len) {
387 *len = size;
388 }
389 return buf;
390}
391
392const redis_result* redis_command::get_result() const
393{

Callers 2

test_hmgetFunction · 0.80
test_mgetFunction · 0.80

Calls 7

dbuf_allocMethod · 0.80
get_typeMethod · 0.45
get_childMethod · 0.45
get_sizeMethod · 0.45
getMethod · 0.45
get_lengthMethod · 0.45
argv_to_stringMethod · 0.45

Tested by 2

test_hmgetFunction · 0.64
test_mgetFunction · 0.64