Bug 1252499 - only insert blank tile when really needed r=liuche
MozReview-Commit-ID: 5O7gUBDl1D4
--- 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});