Optimization

All calls to this methods are made with an actual String. No sense
beating ourselves with an interface stick.

Change-Id: I6ef98286be6f81f73864b04f3a17e68f36a6e542
main
Jean Chalard 2012-03-15 14:40:45 +09:00
parent 123407261c
commit 4e74658883
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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;
}