Bug 1252499 - only insert blank tile when really needed r=liuche draft
authorAndrzej Hunt <ahunt@mozilla.com>
Tue, 01 Mar 2016 09:32:16 -0800
changeset 335846 485fcc15de36edb66862588a9821e3af0b47f160
parent 335845 47eb779302fa63ada9a1f7e10c0107ea0b08a9bd
child 335848 89c91e34b3d7f723e88a607d3aadacd09d47139a
push id11890
push userahunt@mozilla.com
push dateTue, 01 Mar 2016 17:32:28 +0000
reviewersliuche
bugs1252499
milestone47.0a1
Bug 1252499 - only insert blank tile when really needed r=liuche MozReview-Commit-ID: 5O7gUBDl1D4
mobile/android/base/java/org/mozilla/gecko/db/LocalBrowserDB.java
--- a/mobile/android/base/java/org/mozilla/gecko/db/LocalBrowserDB.java
+++ b/mobile/android/base/java/org/mozilla/gecko/db/LocalBrowserDB.java
@@ -1675,17 +1675,17 @@ public class LocalBrowserDB implements B
                                          null);
 
         // It's possible that we will retrieve fewer sites than are required to fill the top-sites panel - in this case
         // we need to add "blank" tiles. It's much easier to add these here (as opposed to SQL), since we don't care
         // about their ordering (they go after all the other sites), but we do care about their number (and calculating
         // that inside out topsites SQL query would be difficult given the other processing we're already doing there).
         final int blanksRequired = suggestedRangeLimit - topSitesCursor.getCount();
 
-        if (blanksRequired < 0) {
+        if (blanksRequired <= 0) {
             return topSitesCursor;
         }
 
         MatrixCursor blanksCursor = new MatrixCursor(new String[] {
                 Bookmarks._ID,
                 Bookmarks.URL,
                 Bookmarks.TITLE,
                 Bookmarks.TYPE});