mirror of
https://github.com/expo/bsdiff.git
synced 2026-11-14 17:49:03 -10:00
Merge "Exit loop ealier when matching lastoffset."
This commit is contained in:
commit
365012ab68
1 file changed
+3
-4
@@ -114,10 +114,9 @@ int bsdiff(const uint8_t* old_buf, size_t oldsize, const uint8_t* new_buf,
|
||||
|
||||
sai->SearchPrefix(new_buf + scan, newsize - scan, &len, &pos);
|
||||
|
||||
for(;scsc<scan+len;scsc++)
|
||||
if((scsc+lastoffset<oldsize) &&
|
||||
(old_buf[scsc+lastoffset] == new_buf[scsc]))
|
||||
oldscore++;
|
||||
for(;scsc<scan+len && scsc+lastoffset<oldsize;scsc++)
|
||||
if(old_buf[scsc+lastoffset] == new_buf[scsc])
|
||||
oldscore++;
|
||||
|
||||
if(((len==oldscore) && (len!=0)) ||
|
||||
(len>oldscore+8 && len>=min_length)) break;
|
||||
|
||||
Reference in new issue
Block a user