mirror of
https://github.com/expo/bsdiff.git
synced 2026-11-14 17:49:03 -10:00
Merge "Exit loop ealier when matching lastoffset."
am: 365012ab68
Change-Id: Ib1229a6f32fc99d76ee6f0b48b6576aa7250b953
This commit is contained in:
commit
aa1c9404c7
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