From fb9c1c3dbddf7c37f77f310a5bc57c6b5173b422 Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 25 May 2018 16:29:37 +0200 Subject: [PATCH] Simplify XADD ID syntax error code path,. --- src/t_stream.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/t_stream.c b/src/t_stream.c index 600e70ca..d17bf362 100644 --- a/src/t_stream.c +++ b/src/t_stream.c @@ -1063,12 +1063,9 @@ void xaddCommand(client *c) { maxlen_arg_idx = i; } else { /* If we are here is a syntax error or a valid ID. */ - if (streamParseIDOrReply(c,c->argv[i],&id,0) == C_OK) { - id_given = 1; - break; - } else { - return; - } + if (streamParseIDOrReply(c,c->argv[i],&id,0) != C_OK) return; + id_given = 1; + break; } } int field_pos = i+1;