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 )
{
GameListItem result = null;
int count = m_list.getChildCount();
for ( int ii = 0; ii < count; ++ii ) {
View view = m_list.getChildAt( ii );
if ( view instanceof GameListItem ) {
GameListItem tryme = (GameListItem)view;
if ( tryme.getRowID() == rowid ) {
result = tryme;
break;
}
}
}
return result;
Set<Long> rowids = new HashSet<Long>(1);
rowids.add( rowid );
GameListItem[] items = new GameListItem[1];
getGameItemsFor( rowids, items );
return items[0];
}
private GameListGroup getGroupItemFor( int groupPosition )