Bug 1240500 - Pre: whitespace cleanup and unnecessary comment cleanup r=me
authorAndrzej Hunt <ahunt@mozilla.com>
Thu, 25 Feb 2016 14:47:40 -0800
changeset 285751 ec51ade02ea0e58031f3a051c54413e516e865f6
parent 285750 0f3938e0df6405678c951e2541019354c109732b
child 285752 e93550cee4886e3904ca91842ed477924365e2e9
push id30035
push usercbook@mozilla.com
push dateMon, 29 Feb 2016 10:16:00 +0000
treeherdermozilla-central@4972f77869de [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1240500
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1240500 - Pre: whitespace cleanup and unnecessary comment cleanup r=me MozReview-Commit-ID: FDOsOUSitk4
mobile/android/base/java/org/mozilla/gecko/home/SearchEngineRow.java
--- a/mobile/android/base/java/org/mozilla/gecko/home/SearchEngineRow.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/SearchEngineRow.java
@@ -171,17 +171,16 @@ class SearchEngineRow extends AnimatedHe
     private void refreshOccurrencesWith(String pattern, String string) {
         mOccurrences.clear();
         final int patternLength = pattern.length();
         int indexOfMatch = 0;
         int lastIndexOfMatch = 0;
         while(indexOfMatch != -1) {
             indexOfMatch = string.indexOf(pattern, lastIndexOfMatch);
             lastIndexOfMatch = indexOfMatch + patternLength;
-            // Crash here?
             if(indexOfMatch != -1) {
                 mOccurrences.add(indexOfMatch);
             }
         }
     }
 
     /**
      * Sets the content for the suggestion view.
@@ -206,17 +205,17 @@ class SearchEngineRow extends AnimatedHe
         final String searchTerm = getSuggestionTextFromView(mUserEnteredView);
         final int searchTermLength = searchTerm.length();
         refreshOccurrencesWith(searchTerm, suggestion);
         if (mOccurrences.size() > 0) {
             final SpannableStringBuilder sb = new SpannableStringBuilder(suggestion);
             int nextStartSpanIndex = 0;
             // Done to make sure that the stretch of text after the last occurrence, till the end of the suggestion, is made bold
             mOccurrences.add(suggestion.length());
-            for(int occurrence : mOccurrences) {
+            for (int occurrence : mOccurrences) {
                 // Even though they're the same style, SpannableStringBuilder will interpret there as being only one Span present if we re-use a StyleSpan
                 StyleSpan boldSpan = new StyleSpan(Typeface.BOLD);
                 sb.setSpan(boldSpan, nextStartSpanIndex, occurrence, Spannable.SPAN_INCLUSIVE_INCLUSIVE);
                 nextStartSpanIndex = occurrence + searchTermLength;
             }
             mOccurrences.clear();
             suggestionText.setText(sb);
         } else {