tweaks suggested by code review

This commit is contained in:
Eric House 2012-12-29 13:22:00 -08:00
parent 1faf60f667
commit bbf9e8e0df
4 changed files with 8 additions and 19 deletions

View file

@ -84,8 +84,7 @@ public class GameListAdapter implements ExpandableListAdapter {
// Then copy in what's left
Iterator<Long> iter = unused.iterator();
while ( iter.hasNext() ) {
long id = iter.next();
newArray[nextIndx++] = id;
newArray[nextIndx++] = iter.next();
}
m_positions = newArray;
}
@ -317,14 +316,15 @@ public class GameListAdapter implements ExpandableListAdapter {
public int getGroupPosition( long groupid )
{
int pos = -1;
int result = -1;
long[] positions = getPositions();
for ( pos = 0; pos < positions.length; ++pos ) {
for ( int pos = 0; pos < positions.length; ++pos ) {
if ( positions[pos] == groupid ) {
result = pos;
break;
}
}
return pos;
return result;
}
public boolean setField( String fieldName )

View file

@ -33,7 +33,7 @@ public class XWApp extends Application {
public static final boolean GCMSUPPORTED = true;
public static final boolean ATTACH_SUPPORTED = true;
public static final boolean REMATCH_SUPPORTED = false;
public static final boolean DEBUG = true;
public static final boolean DEBUG = false;
public static final boolean DEBUG_LOCKS = false && DEBUG;
public static final boolean DEBUG_EXP_TIMERS = false && DEBUG;

View file

@ -1,6 +1,6 @@
/* -*- compile-command: "cd ../../../../../; ant debug install"; -*- */
/*
* Copyright 2010 - 2011 by Eric House (xwords@eehouse.org). All
* Copyright 2010 - 2012 by Eric House (xwords@eehouse.org). All
* rights reserved.
*
* This program is free software; you can redistribute it and/or
@ -103,11 +103,6 @@ public class XWExpandableListActivity extends ExpandableListActivity
m_delegate.showConfirmThen( msg, action );
}
protected void showConfirmThen( int msg, int action )
{
showConfirmThen( getString(msg), action );
}
protected void showConfirmThen( String msg, int posButton, int action )
{
m_delegate.showConfirmThen( msg, posButton, action );
@ -118,18 +113,12 @@ public class XWExpandableListActivity extends ExpandableListActivity
m_delegate.showConfirmThen( getString(msg), posButton, action );
}
// protected void showConfirmThen( String msg, int action )
// {
// m_delegate.showConfirmThen( msg, action );
// }
// DlgDelegate.DlgClickNotify interface
public void dlgButtonClicked( int id, int which )
{
Assert.fail();
}
// BTService.BTEventListener interface
public void eventOccurred( MultiService.MultiEvent event,
final Object ... args )

View file

@ -292,7 +292,7 @@ public class JNIThread extends Thread {
}
byte[] state = XwJNI.game_saveToStream( m_jniGamePtr, m_gi );
if ( Arrays.equals( m_gameAtStart, state ) ) {
DbgUtils.logf( "no change in game; can skip saving" );
// DbgUtils.logf( "no change in game; can skip saving" );
} else {
GameSummary summary = new GameSummary( m_context, m_gi );
XwJNI.game_summarize( m_jniGamePtr, summary );