Some code reorganization.

Use the same local variable inside both branches of an if.

Change-Id: I61f7d506d984f3723ec90604416d1875dd97cd8c
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index fd813c9..28cbc97 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -391,6 +391,7 @@
         StringUtils.removeDupes(mSuggestions);
 
         final SuggestedWords.Builder builder;
+        final ArrayList<SuggestedWords.SuggestedWordInfo> scoreInfoList;
         if (DBG) {
             // TODO: this doesn't take into account the fact that removing dupes from mSuggestions
             // may have made mScores[] and mSuggestions out of sync.
@@ -399,8 +400,7 @@
             double normalizedScore = BinaryDictionary.calcNormalizedScore(
                     typedWord, autoCorrectionSuggestion.toString(),
                     autoCorrectionSuggestionScore);
-            ArrayList<SuggestedWords.SuggestedWordInfo> scoreInfoList =
-                    new ArrayList<SuggestedWords.SuggestedWordInfo>();
+            scoreInfoList = new ArrayList<SuggestedWords.SuggestedWordInfo>();
             scoreInfoList.add(new SuggestedWords.SuggestedWordInfo(autoCorrectionSuggestion, "+",
                     false));
             final int suggestionsSize = mSuggestions.size();
@@ -424,13 +424,8 @@
                 scoreInfoList.add(new SuggestedWords.SuggestedWordInfo(mSuggestions.get(i),
                         "--", false));
             }
-            builder = new SuggestedWords.Builder(scoreInfoList, allowsToBeAutoCorrected,
-                    false /* isPunctuationSuggestions */);
         } else {
-            builder = new SuggestedWords.Builder(
-                    SuggestedWords.Builder.getFromCharSequenceList(mSuggestions),
-                    allowsToBeAutoCorrected,
-                    false /* isPunctuationSuggestions */);
+            scoreInfoList = SuggestedWords.Builder.getFromCharSequenceList(mSuggestions);
         }
 
         boolean autoCorrectionAvailable = hasAutoCorrection;
@@ -440,6 +435,8 @@
         }
         // Don't auto-correct words with multiple capital letter
         autoCorrectionAvailable &= !wordComposer.isMostlyCaps();
+        builder = new SuggestedWords.Builder(scoreInfoList, allowsToBeAutoCorrected,
+                false /* isPunctuationSuggestions */);
         builder.setTypedWordValid(!allowsToBeAutoCorrected).setHasMinimalSuggestion(
                 autoCorrectionAvailable);
         if (allowsToBeAutoCorrected && builder.size() > 1 && mAutoCorrectionThreshold > 0
diff --git a/java/src/com/android/inputmethod/latin/SuggestedWords.java b/java/src/com/android/inputmethod/latin/SuggestedWords.java
index d41f847..f62e99c 100644
--- a/java/src/com/android/inputmethod/latin/SuggestedWords.java
+++ b/java/src/com/android/inputmethod/latin/SuggestedWords.java
@@ -88,7 +88,7 @@
             mIsPunctuationSuggestions = isPunctuationSuggestions;
         }
 
-        public static List<SuggestedWordInfo> getFromCharSequenceList(
+        public static ArrayList<SuggestedWordInfo> getFromCharSequenceList(
                 final List<CharSequence> wordList) {
             final ArrayList<SuggestedWordInfo> result = new ArrayList<SuggestedWordInfo>();
             for (CharSequence word : wordList) {