mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-20 22:26:54 +01:00
reuse code at cost of some extra allocs
This commit is contained in:
parent
2f0f4996ac
commit
44b9afe709
1 changed files with 5 additions and 13 deletions
|
@ -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 )
|
||||
|
|
Loading…
Reference in a new issue