From 4e746588836474b87960f392c716852f3b373c86 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Thu, 15 Mar 2012 14:40:45 +0900 Subject: [PATCH] Optimization All calls to this methods are made with an actual String. No sense beating ourselves with an interface stick. Change-Id: I6ef98286be6f81f73864b04f3a17e68f36a6e542 --- java/src/com/android/inputmethod/latin/SuggestedWords.java | 6 +++--- .../inputmethod/latin/suggestions/SuggestionsView.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/SuggestedWords.java b/java/src/com/android/inputmethod/latin/SuggestedWords.java index 82cfbbf17..09eac4910 100644 --- a/java/src/com/android/inputmethod/latin/SuggestedWords.java +++ b/java/src/com/android/inputmethod/latin/SuggestedWords.java @@ -121,21 +121,21 @@ public class SuggestedWords { public static class SuggestedWordInfo { public final CharSequence mWord; - private final CharSequence mDebugString; + private final String mDebugString; public SuggestedWordInfo(final CharSequence word) { mWord = word; mDebugString = ""; } - public SuggestedWordInfo(final CharSequence word, final CharSequence debugString) { + public SuggestedWordInfo(final CharSequence word, final String debugString) { mWord = word; if (null == debugString) throw new NullPointerException(""); mDebugString = debugString; } public String getDebugString() { - return mDebugString.toString(); + return mDebugString; } @Override diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java index b8f92e40f..a4f0cf5df 100644 --- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java +++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java @@ -502,11 +502,11 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener, hintView, 1.0f - mCenterSuggestionWeight, ViewGroup.LayoutParams.MATCH_PARENT); } - private static CharSequence getDebugInfo(SuggestedWords suggestions, int pos) { + private static String getDebugInfo(SuggestedWords suggestions, int pos) { if (DBG && pos < suggestions.size()) { final SuggestedWordInfo wordInfo = suggestions.getInfo(pos); if (wordInfo != null) { - final CharSequence debugInfo = wordInfo.getDebugString(); + final String debugInfo = wordInfo.getDebugString(); if (!TextUtils.isEmpty(debugInfo)) { return debugInfo; }