optimization: return null quickly if param is invalid

This commit is contained in:
Eric House 2013-11-23 12:16:38 -08:00
parent 6f4cb4b0ca
commit f85bb082fc

View file

@ -420,10 +420,14 @@ public class GameListAdapter implements ExpandableListAdapter {
protected GameListItem getGameItemFor( long rowid )
{
long[] rowids = { rowid };
GameListItem[] items = new GameListItem[1];
getGameItemsFor( rowids, items );
return items[0];
GameListItem result = null;
if ( DBUtils.ROWID_NOTFOUND != rowid ) {
long[] rowids = { rowid };
GameListItem[] items = new GameListItem[1];
getGameItemsFor( rowids, items );
result = items[0];
}
return result;
}
private GameListGroup getGroupItemFor( int groupPosition )