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

Change-Id: Icb32c479371d6de59ba957364c090e3ea2522495