remove unused variable and functions that set it

This commit is contained in:
Eric House 2013-07-30 07:35:13 -07:00
parent 54c1e0c2ab
commit 4ce2368e90

View file

@ -60,7 +60,6 @@ public class DBUtils {
private static long s_cachedRowID = -1; private static long s_cachedRowID = -1;
private static byte[] s_cachedBytes = null; private static byte[] s_cachedBytes = null;
private static long[] s_cachedRowIDs = null;
public static interface DBChangeListener { public static interface DBChangeListener {
public void gameSaved( long rowid, boolean countChanged ); public void gameSaved( long rowid, boolean countChanged );
@ -314,9 +313,6 @@ public class DBUtils {
long result = db.update( DBHelper.TABLE_NAME_SUM, long result = db.update( DBHelper.TABLE_NAME_SUM,
values, selection, null ); values, selection, null );
Assert.assertTrue( result >= 0 ); Assert.assertTrue( result >= 0 );
if ( result != rowid ) { // new row added
clearRowIDsCache();
}
} }
db.close(); db.close();
notifyListeners( rowid, false ); notifyListeners( rowid, false );
@ -700,7 +696,6 @@ public class DBUtils {
long rowid = db.insert( DBHelper.TABLE_NAME_SUM, null, values ); long rowid = db.insert( DBHelper.TABLE_NAME_SUM, null, values );
setCached( rowid, null ); // force reread setCached( rowid, null ); // force reread
clearRowIDsCache();
lock = new GameLock( rowid, true ).lock(); lock = new GameLock( rowid, true ).lock();
notifyListeners( rowid, true ); notifyListeners( rowid, true );
@ -784,17 +779,9 @@ public class DBUtils {
db.delete( DBHelper.TABLE_NAME_SUM, selection, null ); db.delete( DBHelper.TABLE_NAME_SUM, selection, null );
db.close(); db.close();
} }
clearRowIDsCache();
notifyListeners( lock.getRowid(), true ); notifyListeners( lock.getRowid(), true );
} }
private static void clearRowIDsCache()
{
synchronized( DBUtils.class ) {
s_cachedRowIDs = null;
}
}
public static int getVisID( Context context, long rowid ) public static int getVisID( Context context, long rowid )
{ {
int result = -1; int result = -1;
@ -1167,7 +1154,6 @@ public class DBUtils {
public static void loadDB( Context context ) public static void loadDB( Context context )
{ {
clearRowIDsCache();
copyGameDB( context, false ); copyGameDB( context, false );
} }