X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=diff-delta.c;h=9f998d0a73e0127d3a68a7caecb3727569149871;hb=4db0c8dec5c009cbbb61135a321a48278e668a25;hp=51df4608a8186e519bcb3b4e67d421c18efb696a;hpb=2f60e4e9c18c4cbe1ceacad1bb975a6206ec0411;p=git.git diff --git a/diff-delta.c b/diff-delta.c index 51df4608a..9f998d0a7 100644 --- a/diff-delta.c +++ b/diff-delta.c @@ -18,11 +18,8 @@ * licensing gets turned into GPLv2 within this project. */ -#include -#include -#include "delta.h" - #include "git-compat-util.h" +#include "delta.h" /* maximum hash entry list for the same hash bucket */ #define HASH_LIMIT 64 @@ -308,8 +305,8 @@ create_delta(const struct delta_index *index, continue; if (ref_size > top - src) ref_size = top - src; - if (ref_size > 0xffffff) - ref_size = 0xffffff; + if (ref_size > 0x10000) + ref_size = 0x10000; if (ref_size <= msize) break; while (ref_size-- && *src++ == *ref) @@ -318,8 +315,6 @@ create_delta(const struct delta_index *index, /* this is our best match so far */ msize = ref - entry->ptr; moff = entry->ptr - ref_data; - if (msize >= 0x10000) - break; /* this is good enough */ } } @@ -383,8 +378,6 @@ create_delta(const struct delta_index *index, if (msize & 0xff) { out[outpos++] = msize; i |= 0x10; } msize >>= 8; if (msize & 0xff) { out[outpos++] = msize; i |= 0x20; } - msize >>= 8; - if (msize & 0xff) { out[outpos++] = msize; i |= 0x40; } *op = i; }