@matheusbsbs / matheus-bagliano / commits / 968a1d65f4
Fork 0

read-cache.c cleanup

Removes conditional returns. Signed-off-by: David Rientjes <rientjes@google.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

David Rientjes committed Aug 14, 2006 at 13:38 UTC 968a1d65f430e4e8234204c62361e3d21cac810c
1 file changed +3 -7
read-cache.c
+3 -7
@@ -880,10 +880,8 @@ static int write_index_ext_header(SHA_CTX *context, int fd,
880 {
881 ext = htonl(ext);
882 sz = htonl(sz);
883 - if ((ce_write(context, fd, &ext, 4) < 0) ||
884 - (ce_write(context, fd, &sz, 4) < 0))
885 - return -1;
886 - return 0;
883 + return ((ce_write(context, fd, &ext, 4) < 0) ||
884 + (ce_write(context, fd, &sz, 4) < 0)) ? -1 : 0;
885 }
886
887 static int ce_flush(SHA_CTX *context, int fd)
@@ -905,9 +903,7 @@ static int ce_flush(SHA_CTX *context, int fd)
903 /* Append the SHA1 signature at the end */
904 SHA1_Final(write_buffer + left, context);
905 left += 20;
908 - if (write(fd, write_buffer, left) != left)
909 - return -1;
910 - return 0;
906 + return (write(fd, write_buffer, left) != left) ? -1 : 0;
907 }
908
909 static void ce_smudge_racily_clean_entry(struct cache_entry *ce)