From e9f5e87781e88aa3afa7679783c204604479f9e9 Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Tue, 3 Feb 2009 18:25:13 +0000 Subject: [PATCH] Rearrange some code to improve clarity In particular, the test for z-stream input completion (zs.avail_in != 0) logically belongs with the test for the Z_STREAM_END stream status. This is also consistent with the identical check in finish_inflate(). Signed-off-by: Ramsay Jones Signed-off-by: Shawn O. Pearce --- src/odb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/odb.c b/src/odb.c index a77eac7c3..fc58168ad 100644 --- a/src/odb.c +++ b/src/odb.c @@ -390,10 +390,10 @@ static int inflate_buffer(void *in, size_t inlen, void *out, size_t outlen) inflateEnd(&zs); - if ((status != Z_STREAM_END) || (zs.total_out != outlen)) + if ((status != Z_STREAM_END) || (zs.avail_in != 0)) return GIT_ERROR; - if (zs.avail_in != 0) + if (zs.total_out != outlen) return GIT_ERROR; return GIT_SUCCESS;