Skip to content

Commit

Permalink
fix type order
Browse files Browse the repository at this point in the history
Signed-off-by: zhaozhao.zz <[email protected]>
  • Loading branch information
soloestoy committed Nov 13, 2024
1 parent 7c33199 commit 6caadba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/commandlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,14 @@ void commandlogCommand(client *c) {
"count should be greater than or equal to -1") != C_OK)
return;

if ((type = commandlogGetTypeOrReply(c, c->argv[3])) == -1) return;

if (count == -1) {
/* We treat -1 as a special value, which means to get all command logs.
* Simply set count to the length of server.commandlog. */
count = listLength(server.commandlog[type].entries);
}

if ((type = commandlogGetTypeOrReply(c, c->argv[3])) == -1) return;

commandlogGetReply(c, type, count);
} else {
addReplySubcommandSyntaxError(c);
Expand Down

0 comments on commit 6caadba

Please sign in to comment.