# HG changeset patch # User Adam Gashlin # Date 1520380160 28800 # Node ID 660d7b66d239b2d89f0b1a4e0f9d7a866ad3af56 # Parent ba5bfdf2b72b21ab2bfcd1a67c54153c2dd3d85a Bug 1434513 - Adjust bsdiff heuristics. r=glandium diff --git a/other-licenses/bsdiff/bsdiff.c b/other-licenses/bsdiff/bsdiff.c --- a/other-licenses/bsdiff/bsdiff.c +++ b/other-licenses/bsdiff/bsdiff.c @@ -299,39 +299,39 @@ int main(int argc,char *argv[]) 0,oldsize,&pos); for(;scscoldscore+8)) break; + (len>oldscore+10)) break; if((scan+lastoffsetSf*2-lenf) { Sf=s; lenf=i; }; + if(s*3-i*2>Sf*3-lenf*2) { Sf=s; lenf=i; }; }; lenb=0; if(scan=lastscan+i)&&(pos>=i);i++) { if(old[pos-i]==newbuf[scan-i]) s++; - if(s*2-i>Sb*2-lenb) { Sb=s; lenb=i; }; + if(s*3-i*2>Sb*3-lenb*2) { Sb=s; lenb=i; }; }; }; if(lastscan+lenf>scan-lenb) { overlap=(lastscan+lenf)-(scan-lenb); s=0;Ss=0;lens=0; for(i=0;i