git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: git@vger.kernel.org
Subject: [PATCH 24/28] read-cache.c cleanup
Date: Mon, 14 Aug 2006 13:38:14 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.63.0608141337420.19383@chino.corp.google.com> (raw)

Removes conditional returns.

		David

Signed-off-by: David Rientjes <rientjes@google.com>
---
 read-cache.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/read-cache.c b/read-cache.c
index c923a32..b18f9f7 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -880,10 +880,8 @@ static int write_index_ext_header(SHA_CT
 {
 	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, in
 	/* 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)
-- 
1.4.2.g89bb-dirty

                 reply	other threads:[~2006-08-14 20:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.63.0608141337420.19383@chino.corp.google.com \
    --to=rientjes@google.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).