Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
Signed-off-by: Ze Gan <ganze718@gmail.com>
  • Loading branch information
Pterosaur committed Jul 12, 2023
1 parent 142c060 commit e73f7ad
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion common/rediscommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ int RedisCommand::appendTo(redisContext *ctx) const
return redisAppendFormattedCommand(ctx, c_str(), length());
}

std::string RedisCommand::printable_string() const
std::string RedisCommand::toPrintableString() const
{
return binary_to_printable(temp, len);
}
Expand Down
11 changes: 6 additions & 5 deletions common/rediscommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class RedisCommand {
void formatArgv(int argc, const char **argv, const size_t *argvlen);
void format(const std::vector<std::string> &commands);

int appendTo(redisContext *ctx) const;

std::string toPrintableString() const;

/* Format HMSET key multiple field value command */
#ifndef SWIG
__attribute__((deprecated))
Expand Down Expand Up @@ -66,14 +70,11 @@ class RedisCommand {
/* Format DEL key command */
void formatDEL(const std::string& key);

int appendTo(redisContext *ctx) const;
const char *c_str() const __attribute__((deprecated));

std::string printable_string() const;
size_t length() const __attribute__((deprecated));

private:
const char *c_str() const;

size_t length() const;

char *temp;
int len;
Expand Down
6 changes: 3 additions & 3 deletions common/redisreply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ RedisReply::RedisReply(RedisContext *ctx, const RedisCommand& command)
rc = redisGetReply(ctx->getContext(), (void**)&m_reply);
if (rc != REDIS_OK)
{
throw RedisError("Failed to redisGetReply with " + command.printable_string(), ctx->getContext());
throw RedisError("Failed to redisGetReply with " + command.toPrintableString(), ctx->getContext());
}
guard([&]{checkReply();}, command.printable_string().c_str());
guard([&]{checkReply();}, command.toPrintableString().c_str());
}

RedisReply::RedisReply(RedisContext *ctx, const string& command)
Expand All @@ -115,7 +115,7 @@ RedisReply::RedisReply(RedisContext *ctx, const string& command)
RedisReply::RedisReply(RedisContext *ctx, const RedisCommand& command, int expectedType)
: RedisReply(ctx, command)
{
guard([&]{checkReplyType(expectedType);}, command.printable_string().c_str());
guard([&]{checkReplyType(expectedType);}, command.toPrintableString().c_str());
}

RedisReply::RedisReply(RedisContext *ctx, const string& command, int expectedType)
Expand Down

0 comments on commit e73f7ad

Please sign in to comment.