diff options
author | Guy Korland <gkorland@gmail.com> | 2020-10-12 17:15:29 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-12 17:15:29 +0300 |
commit | b086f763e79fea24d227450da07d877f91436130 (patch) | |
tree | b36ce21724d524ee3d8b7fb66840d7c63f13acd0 | |
parent | b47fae4e7012a9e868db4e0cdfd2fb078a715706 (diff) |
clean a warning, remvoe empty else block
-rw-r--r-- | hiredis.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -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; |