diff options
| author | Gilles Debunne <debunne@google.com> | 2011-01-25 09:09:46 -0800 |
|---|---|---|
| committer | Gilles Debunne <debunne@google.com> | 2011-01-25 09:09:46 -0800 |
| commit | f902d7bc49797ec277b4576c921dfffa15d741dd (patch) | |
| tree | b75182b0f4f519639e803d0ef7eb89d4fbcb4829 /core/java/android/text/TextLine.java | |
| parent | aaa55d3f45744814907d0809befb49281ced462e (diff) | |
TextLine cache is used, even for long lines of text.
Bug 3381368
The 250 characters limit is passed for long URLs. There are only 3
TextLine objects, so their total size is not an issue. Recycle long
lines as well to make sure we fill the cache and avoid object creation.
Change-Id: I843bf623594312a0fcf0edbb13b7cd64cce0ddd1
Diffstat (limited to 'core/java/android/text/TextLine.java')
| -rw-r--r-- | core/java/android/text/TextLine.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/core/java/android/text/TextLine.java b/core/java/android/text/TextLine.java index a6fd2f11ab38..90279d1f63c9 100644 --- a/core/java/android/text/TextLine.java +++ b/core/java/android/text/TextLine.java @@ -90,13 +90,11 @@ class TextLine { tl.mText = null; tl.mPaint = null; tl.mDirections = null; - if (tl.mLen < 250) { - synchronized(cached) { - for (int i = 0; i < cached.length; ++i) { - if (cached[i] == null) { - cached[i] = tl; - break; - } + synchronized(cached) { + for (int i = 0; i < cached.length; ++i) { + if (cached[i] == null) { + cached[i] = tl; + break; } } } |
