summaryrefslogtreecommitdiff
path: root/xdiff/xdiffi.c
diff options
context:
space:
mode:
authorDavide Libenzi <davidel@xmailserver.org>2006-04-03 18:47:55 -0700
committerJunio C Hamano <junkio@cox.net>2006-04-04 00:11:09 -0700
commitca557afff9f7dad7a8739cd193ac0730d872e282 (patch)
treea5280cb50743f26130e9dabcea0fc7a92f8dc193 /xdiff/xdiffi.c
parentfc9957b0052df6a8248420395bc9febd66194252 (diff)
downloadgit-ca557afff9f7dad7a8739cd193ac0730d872e282.tar.gz
Clean-up trivially redundant diff.
Also corrects the line numbers in unified output when using zero lines context.
Diffstat (limited to 'xdiff/xdiffi.c')
-rw-r--r--xdiff/xdiffi.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c
index 8ea04837ec..e81bca633e 100644
--- a/xdiff/xdiffi.c
+++ b/xdiff/xdiffi.c
@@ -349,12 +349,7 @@ int xdl_do_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
kvdf += xe->xdf2.nreff + 1;
kvdb += xe->xdf2.nreff + 1;
- /*
- * Classical integer square root approximation using shifts.
- */
- xenv.mxcost = 1;
- for (; ndiags; ndiags >>= 2)
- xenv.mxcost <<= 1;
+ xenv.mxcost = xdl_bogosqrt(ndiags);
if (xenv.mxcost < XDL_MAX_COST_MIN)
xenv.mxcost = XDL_MAX_COST_MIN;
xenv.snake_cnt = XDL_SNAKE_CNT;