From: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
To: t.gummerer@gmail.com
Cc: Junio C Hamano <gitster@pobox.com>,
GIT Mailing-list <git@vger.kernel.org>
Subject: [PATCH 3/3] read-cache.c: Simplify do loop conditional expression
Date: Tue, 04 Sep 2012 20:05:17 +0100 [thread overview]
Message-ID: <504650ED.1040801@ramsay1.demon.co.uk> (raw)
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
Hi Thomas,
I note that index_changed(), which has no side effects, is called with
unchanged parameters twice each time around the loop. I was about to
suggest saving the result of a single call and using it in both places ...
However, on first sight, it looks like the expression in the while
condition will always be true (otherwise you would not reach that point
in the code - you would already have returned), so we can simply remove
that part of the expression (however, I didn't look too closely, so ...)
:-D
ATB,
Ramsay Jones
read-cache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/read-cache.c b/read-cache.c
index 36f0877..5176d7a 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -1278,7 +1278,7 @@ int read_index_from(struct index_state *istate, const char *path)
usleep(10*1000);
i++;
- } while ((err || index_changed(&st_old, &st_new)) && i < 50);
+ } while (i < 50);
munmap(mmap, mmap_size);
die("index file corrupt");
--
1.7.12
reply other threads:[~2012-09-04 19:08 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=504650ED.1040801@ramsay1.demon.co.uk \
--to=ramsay@ramsay1.demon.co.uk \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=t.gummerer@gmail.com \
/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).