Commit c426bbf3 authored by Oran Agra's avatar Oran Agra
Browse files

Slightly more efficient RM_ReplyWithEmptyString

trimming talk about RESP protocol from API docs (should be independent to that anyway)
parent 0f026af1
...@@ -1389,7 +1389,7 @@ int RM_ReplyWithString(RedisModuleCtx *ctx, RedisModuleString *str) { ...@@ -1389,7 +1389,7 @@ int RM_ReplyWithString(RedisModuleCtx *ctx, RedisModuleString *str) {
int RM_ReplyWithEmptyString(RedisModuleCtx *ctx) { int RM_ReplyWithEmptyString(RedisModuleCtx *ctx) {
client *c = moduleGetReplyClient(ctx); client *c = moduleGetReplyClient(ctx);
if (c == NULL) return REDISMODULE_OK; if (c == NULL) return REDISMODULE_OK;
addReplyBulkCBuffer(c, "", 0); addReply(c,shared.emptybulk);
return REDISMODULE_OK; return REDISMODULE_OK;
} }
...@@ -1404,8 +1404,7 @@ int RM_ReplyWithVerbatimString(RedisModuleCtx *ctx, const char *buf, size_t len) ...@@ -1404,8 +1404,7 @@ int RM_ReplyWithVerbatimString(RedisModuleCtx *ctx, const char *buf, size_t len)
return REDISMODULE_OK; return REDISMODULE_OK;
} }
/* Reply to the client with a NULL. In the RESP protocol a NULL is encoded /* Reply to the client with a NULL.
* as the string "$-1\r\n".
* *
* The function always returns REDISMODULE_OK. */ * The function always returns REDISMODULE_OK. */
int RM_ReplyWithNull(RedisModuleCtx *ctx) { int RM_ReplyWithNull(RedisModuleCtx *ctx) {
......
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