aboutsummaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorDavid Rientjes <rientjes@google.com>2006-08-14 13:38:14 -0700
committerJunio C Hamano <junkio@cox.net>2006-08-14 18:41:12 -0700
commit968a1d65f430e4e8234204c62361e3d21cac810c (patch)
tree2e6c0009783fab04427da81e407f772a8dcffea4 /read-cache.c
parent0bc87ffb6c8edbb44bd72a4e1a5aa81c64f7eb37 (diff)
downloadgit-968a1d65f430e4e8234204c62361e3d21cac810c.tar.gz
git-968a1d65f430e4e8234204c62361e3d21cac810c.tar.xz
read-cache.c cleanup
Removes conditional returns. Signed-off-by: David Rientjes <rientjes@google.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/read-cache.c b/read-cache.c
index c923a3270..b18f9f72d 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -880,10 +880,8 @@ static int write_index_ext_header(SHA_CTX *context, int fd,
{
ext = htonl(ext);
sz = htonl(sz);
- if ((ce_write(context, fd, &ext, 4) < 0) ||
- (ce_write(context, fd, &sz, 4) < 0))
- return -1;
- return 0;
+ return ((ce_write(context, fd, &ext, 4) < 0) ||
+ (ce_write(context, fd, &sz, 4) < 0)) ? -1 : 0;
}
static int ce_flush(SHA_CTX *context, int fd)
@@ -905,9 +903,7 @@ static int ce_flush(SHA_CTX *context, int fd)
/* Append the SHA1 signature at the end */
SHA1_Final(write_buffer + left, context);
left += 20;
- if (write(fd, write_buffer, left) != left)
- return -1;
- return 0;
+ return (write(fd, write_buffer, left) != left) ? -1 : 0;
}
static void ce_smudge_racily_clean_entry(struct cache_entry *ce)