Early exit if the target region is empty

Bug: 193849901
Test: atest StaticLayoutBidiTouchTest
Change-Id: I55f04068a6e5b353867d50742356c272d28886b3
This commit is contained in:
Seigo Nonaka
2021-07-23 15:43:22 -07:00
parent e31184cb46
commit 3582d26e2a

View File

@@ -782,7 +782,7 @@ public class TextLine {
int spanStart = runStart;
int spanLimit;
if (mSpanned == null) {
if (mSpanned == null || runStart == runLimit) {
spanLimit = runLimit;
} else {
int target = after ? offset + 1 : offset;