mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-01 19:57:11 +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 )
|
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 )
|
||||||
|
|
Loading…
Add table
Reference in a new issue