aboutsummaryrefslogtreecommitdiff
path: root/xdiff/xprepare.c
diff options
context:
space:
mode:
authorTay Ray Chuan <rctay89@gmail.com>2011-08-01 12:20:07 +0800
committerJunio C Hamano <gitster@pobox.com>2011-08-03 10:15:16 -0700
commit739864b1ffb379120df9cfa4111c4ec20b823cfd (patch)
treeebbe27f1f19b804ca2864ecfc11a7bda0b131826 /xdiff/xprepare.c
parent286e2b1a23d523b04c29f92eb5cee31a0a92dc12 (diff)
downloadgit-739864b1ffb379120df9cfa4111c4ec20b823cfd.tar.gz
git-739864b1ffb379120df9cfa4111c4ec20b823cfd.tar.xz
xdiff: do away with xdl_mmfile_next()
Given our simple mmfile structure, xdl_mmfile_next() calls are redundant. Do away with calls to them. Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'xdiff/xprepare.c')
-rw-r--r--xdiff/xprepare.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/xdiff/xprepare.c b/xdiff/xprepare.c
index dfbb0de98..620fc9a65 100644
--- a/xdiff/xprepare.c
+++ b/xdiff/xprepare.c
@@ -168,12 +168,7 @@ static int xdl_prepare_ctx(mmfile_t *mf, long narec, xpparam_t const *xpp,
nrec = 0;
if ((cur = blk = xdl_mmfile_first(mf, &bsize)) != NULL) {
- for (top = blk + bsize;;) {
- if (cur >= top) {
- if (!(cur = blk = xdl_mmfile_next(mf, &bsize)))
- break;
- top = blk + bsize;
- }
+ for (top = blk + bsize; cur < top; ) {
prev = cur;
hav = xdl_hash_record(&cur, top, xpp->flags);
if (nrec >= narec) {