Unverified Commit ad45d7e4 authored by Salvatore Sanfilippo's avatar Salvatore Sanfilippo Committed by GitHub
Browse files

Merge pull request #6385 from filipecosta90/perf-reply-ss-error

Improve performance of RM_ReplyWithSimpleString and RM_ReplyWi…
parents 916c4e5d af15b285
......@@ -1149,10 +1149,11 @@ int RM_ReplyWithLongLong(RedisModuleCtx *ctx, long long ll) {
int replyWithStatus(RedisModuleCtx *ctx, const char *msg, char *prefix) {
client *c = moduleGetReplyClient(ctx);
if (c == NULL) return REDISMODULE_OK;
sds strmsg = sdsnewlen(prefix,1);
strmsg = sdscat(strmsg,msg);
strmsg = sdscatlen(strmsg,"\r\n",2);
addReplySds(c,strmsg);
const size_t msgLen = strlen(msg);
const size_t prefixLen = strlen(prefix);
addReplyProto(c,prefix,prefixLen);
addReplyProto(c,msg,msgLen);
addReplyProto(c,"\r\n",2);
return REDISMODULE_OK;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment