diff options
author | Tay Ray Chuan <rctay89@gmail.com> | 2011-08-01 12:20:07 +0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-03 10:15:16 -0700 |
commit | 739864b1ffb379120df9cfa4111c4ec20b823cfd (patch) | |
tree | ebbe27f1f19b804ca2864ecfc11a7bda0b131826 /xdiff/xutils.c | |
parent | 286e2b1a23d523b04c29f92eb5cee31a0a92dc12 (diff) | |
download | git-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/xutils.c')
-rw-r--r-- | xdiff/xutils.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/xdiff/xutils.c b/xdiff/xutils.c index a45e89bbe..0de084e53 100644 --- a/xdiff/xutils.c +++ b/xdiff/xutils.c @@ -67,12 +67,6 @@ void *xdl_mmfile_first(mmfile_t *mmf, long *size) } -void *xdl_mmfile_next(mmfile_t *mmf, long *size) -{ - return NULL; -} - - long xdl_mmfile_size(mmfile_t *mmf) { return mmf->size; @@ -160,13 +154,7 @@ long xdl_guess_lines(mmfile_t *mf, long sample) { char const *data, *cur, *top; if ((cur = data = xdl_mmfile_first(mf, &size)) != NULL) { - for (top = data + size; nl < sample;) { - if (cur >= top) { - tsize += (long) (cur - data); - if (!(cur = data = xdl_mmfile_next(mf, &size))) - break; - top = data + size; - } + for (top = data + size; nl < sample && cur < top; ) { nl++; if (!(cur = memchr(cur, '\n', top - cur))) cur = top; |