reuse code at cost of some extra allocs

This commit is contained in:
Eric House 2013-10-14 07:54:19 -07:00
parent 2f0f4996ac
commit 44b9afe709

View file

@ -393,19 +393,11 @@ public class GameListAdapter implements ExpandableListAdapter {
private GameListItem getGameItemFor( long rowid ) private GameListItem getGameItemFor( long rowid )
{ {
GameListItem result = null; Set<Long> rowids = new HashSet<Long>(1);
int count = m_list.getChildCount(); rowids.add( rowid );
for ( int ii = 0; ii < count; ++ii ) { GameListItem[] items = new GameListItem[1];
View view = m_list.getChildAt( ii ); getGameItemsFor( rowids, items );
if ( view instanceof GameListItem ) { return items[0];
GameListItem tryme = (GameListItem)view;
if ( tryme.getRowID() == rowid ) {
result = tryme;
break;
}
}
}
return result;
} }
private GameListGroup getGroupItemFor( int groupPosition ) private GameListGroup getGroupItemFor( int groupPosition )