From b086f763e79fea24d227450da07d877f91436130 Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Mon, 12 Oct 2020 17:15:29 +0300 Subject: clean a warning, remvoe empty else block --- hiredis.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hiredis.c b/hiredis.c index a7fbf48..1170d75 100644 --- a/hiredis.c +++ b/hiredis.c @@ -938,13 +938,11 @@ int redisBufferRead(redisContext *c) { return REDIS_ERR; nread = c->funcs->read(c, buf, sizeof(buf)); - if (nread > 0) { - if (redisReaderFeed(c->reader, buf, nread) != REDIS_OK) { - __redisSetError(c, c->reader->err, c->reader->errstr); - return REDIS_ERR; - } else { - } - } else if (nread < 0) { + if (nread < 0) { + return REDIS_ERR; + } + if (nread > 0 && redisReaderFeed(c->reader, buf, nread) != REDIS_OK) { + __redisSetError(c, c->reader->err, c->reader->errstr); return REDIS_ERR; } return REDIS_OK; -- cgit v1.2.3