switch (reply->type) {
case REDIS_REPLY_STRING: {
- *block = std::string(reply->str, reply->len);
- // std::string copies the memory so this won't cause any problems
+ block->assign(reply->str, reply->len);
freeReplyObject(reply);
return;
}
"Redis command 'HGET %s %s' errored: ") + errstr);
}
case REDIS_REPLY_NIL: {
- *block = "";
- // block not found in database
+ block->clear();
freeReplyObject(reply);
return;
}