Merge "Exit loop ealier when matching lastoffset." am: 365012ab68

am: aa1c9404c7

Change-Id: I0658fcfd95338d431b4e86ab5302966eeb924bf5
This commit is contained in:
Sen Jiang authored and android-build-merger committed 2018-04-10 15:06:48 -07:00
commit d1d34782a1
1 file changed
+3 -4
+3 -4
View File
@@ -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;