Revert "getApps(): Start Map size with the number of apps we have"

This reverts commit 21747dcf408bef108187588c5ba8b8d72c4b34dc.
This commit is contained in:
Daniel Martí 2014-01-07 08:54:02 +01:00
parent a6379a8006
commit e8337aad30

View File

@ -810,16 +810,8 @@ public class DB {
} }
} }
// Start the map at the actual number of apps we will have Map<String, App> apps = new HashMap<String, App>();
Cursor c = db.rawQuery("select count(*) from "+TABLE_APP, null); Cursor c = null;
c.moveToFirst();
int count = c.getInt(0);
c.close();
c = null;
Log.d("FDroid", "Will be fetching " + count + " apps, and this took us ");
Map<String, App> apps = new HashMap<String, App>(count);
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
try { try {
@ -877,7 +869,7 @@ public class DB {
c.close(); c.close();
c = null; c = null;
Log.d("FDroid", "Read app data from database (took " Log.d("FDroid", "Read app data from database " + " (took "
+ (System.currentTimeMillis() - startTime) + " ms)"); + (System.currentTimeMillis() - startTime) + " ms)");
List<Repo> repos = getRepos(); List<Repo> repos = getRepos();
@ -936,7 +928,7 @@ public class DB {
c.close(); c.close();
} }
Log.d("FDroid", "Read app and apk data from database (took " Log.d("FDroid", "Read app and apk data from database " + " (took "
+ (System.currentTimeMillis() - startTime) + " ms)"); + (System.currentTimeMillis() - startTime) + " ms)");
} }