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 ) protected GameListItem getGameItemFor( long rowid )
{ {
long[] rowids = { rowid }; GameListItem result = null;
GameListItem[] items = new GameListItem[1]; if ( DBUtils.ROWID_NOTFOUND != rowid ) {
getGameItemsFor( rowids, items ); long[] rowids = { rowid };
return items[0]; GameListItem[] items = new GameListItem[1];
getGameItemsFor( rowids, items );
result = items[0];
}
return result;
} }
private GameListGroup getGroupItemFor( int groupPosition ) private GameListGroup getGroupItemFor( int groupPosition )