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

Skip to content
Commit 0b48cef7 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Optimize TextView#onDraw() a bit

With my previous commit [1], it is now safe to swap reorder nested if
conditions from

  if (imm.hasActiveInputConnection(mTextView)) {
    if (additionalCondition) {
      // do something
    }
  }

to

  if (additionalCondition) {
    if (imm.hasActiveInputConnection(mTextView)) {
      // do something
    }
  }

as IMM#hasActiveInputConnection() is guaranteed to have no side
effect.  Let's do lightweight checks first for better performance.

 [1]: I27f2d66050588c5adc6315160e54486131f3fca2

Bug: 291826769
Test: presubmit
Test: atest CtsInputMethodTestCases
Change-Id: I9b613e71ae05494474c7f1a688c332d0c2836ef9
parent 50cf27b0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment