Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f1f74e2 authored by Petar Šegina's avatar Petar Šegina
Browse files

Move consumer call outside of the branch

Test: bit FrameworksCoreTests:android.text.LayoutTest
Change-Id: I4fae9d2b16c22e7ab3856959edc5a57f4276f22f
parent 3a92fb63
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -1732,14 +1732,12 @@ public abstract class Layout {
                    float left = Math.min(h1, h2);
                    float right = Math.max(h1, h2);

                    final boolean isRtl = (dirs.mDirections[i + 1] & RUN_RTL_FLAG) != 0;
                    if (isRtl) {
                        consumer.accept(left, top, right, bottom,
                                TEXT_SELECTION_LAYOUT_RIGHT_TO_LEFT);
                    } else {
                        consumer.accept(left, top, right, bottom,
                                TEXT_SELECTION_LAYOUT_LEFT_TO_RIGHT);
                    }
                    final @TextSelectionLayout int layout =
                            ((dirs.mDirections[i + 1] & RUN_RTL_FLAG) != 0)
                                    ? TEXT_SELECTION_LAYOUT_RIGHT_TO_LEFT
                                    : TEXT_SELECTION_LAYOUT_LEFT_TO_RIGHT;

                    consumer.accept(left, top, right, bottom, layout);
                }
            }
        }