xdiff/xprepare: use a smaller sample size for histogram diff
[gitweb.git] / xdiff / xutils.c
index ded7c327dc3bbc5b5f6dc92e8b1b751671450520..a45e89bbed5ba582f31aff62b13fd6ddb27b1a85 100644 (file)
 
 
 
-#define XDL_GUESS_NLINES 256
-
-
-
 
 long xdl_bogosqrt(long n) {
        long i;
@@ -159,12 +155,12 @@ void *xdl_cha_next(chastore_t *cha) {
 }
 
 
-long xdl_guess_lines(mmfile_t *mf) {
+long xdl_guess_lines(mmfile_t *mf, long sample) {
        long nl = 0, size, tsize = 0;
        char const *data, *cur, *top;
 
        if ((cur = data = xdl_mmfile_first(mf, &size)) != NULL) {
-               for (top = data + size; nl < XDL_GUESS_NLINES;) {
+               for (top = data + size; nl < sample;) {
                        if (cur >= top) {
                                tsize += (long) (cur - data);
                                if (!(cur = data = xdl_mmfile_next(mf, &size)))