don't write DB column that's never read, nor pass the value that was

being written.
This commit is contained in:
Eric House 2016-01-12 00:09:34 -08:00
parent bb2ebe8128
commit a1f590642a
3 changed files with 8 additions and 25 deletions

View file

@ -70,7 +70,8 @@ public class DBHelper extends SQLiteOpenHelper {
public static final String CONTYPE = "CONTYPE";
public static final String SERVERROLE = "SERVERROLE";
public static final String ROOMNAME = "ROOMNAME";
public static final String INVITEID = "INVITEID";
// written but never read; can go away
// public static final String INVITEID = "INVITEID";
public static final String RELAYID = "RELAYID";
public static final String SEED = "SEED";
public static final String SMSPHONE = "SMSPHONE"; // unused -- so far
@ -126,7 +127,6 @@ public class DBHelper extends SQLiteOpenHelper {
,{ SERVERROLE, "INTEGER" }
,{ CONTYPE, "INTEGER" }
,{ ROOMNAME, "TEXT" }
,{ INVITEID, "TEXT" }
,{ RELAYID, "TEXT" }
,{ SEED, "INTEGER" }
,{ DICTLANG, "INTEGER" }
@ -254,7 +254,6 @@ public class DBHelper extends SQLiteOpenHelper {
case 9:
addSumColumn( db, DICTLIST );
case 10:
addSumColumn( db, INVITEID );
case 11:
addSumColumn( db, REMOTEDEVS );
case 12:

View file

@ -271,12 +271,6 @@ public class DBUtils {
public static void saveSummary( Context context, GameLock lock,
GameSummary summary )
{
saveSummary( context, lock, summary, null );
}
public static void saveSummary( Context context, GameLock lock,
GameSummary summary, String inviteID )
{
boolean needsTimer = false;
Assert.assertTrue( lock.canWrite() );
@ -305,9 +299,6 @@ public class DBUtils {
values.put( DBHelper.NEXTNAG, nextNag );
values.put( DBHelper.DICTLIST, summary.dictNames(DICTS_SEP) );
if ( null != inviteID ) {
values.put( DBHelper.INVITEID, inviteID );
}
if ( null != summary.scores ) {
StringBuffer sb = new StringBuffer();

View file

@ -543,7 +543,7 @@ public class GameUtils {
if ( DBUtils.ROWID_NOTFOUND != rowid ) {
GameLock lock = new GameLock( rowid, true ).lock();
applyChanges( context, sink, gi, util, addr, inviteID, lock, false );
applyChanges( context, sink, gi, util, addr, lock, false );
lock.unlock();
}
@ -986,24 +986,17 @@ public class GameUtils {
} // replaceDicts
public static void applyChanges( Context context, CurGameInfo gi,
CommsAddrRec car, GameLock lock,
CommsAddrRec car, GameLock lock,
boolean forceNew )
{
applyChanges( context, gi, car, null, lock, forceNew );
}
public static void applyChanges( Context context, CurGameInfo gi,
CommsAddrRec car, String inviteID,
GameLock lock, boolean forceNew )
{
applyChanges( context, (MultiMsgSink)null, gi, (UtilCtxt)null, car,
inviteID, lock, forceNew );
lock, forceNew );
}
public static void applyChanges( Context context, MultiMsgSink sink,
CurGameInfo gi, UtilCtxt util,
CommsAddrRec car, String inviteID,
GameLock lock, boolean forceNew )
CommsAddrRec car, GameLock lock,
boolean forceNew )
{
// This should be a separate function, commitChanges() or
// somesuch. But: do we have a way to save changes to a gi
@ -1049,7 +1042,7 @@ public class GameUtils {
GameSummary summary = new GameSummary( context, gi );
XwJNI.game_summarize( gamePtr, summary );
DBUtils.saveSummary( context, lock, summary, inviteID );
DBUtils.saveSummary( context, lock, summary );
XwJNI.game_dispose( gamePtr );
} // applyChanges