mirror of
https://github.com/moparisthebest/Yaaic
synced 2024-11-23 09:22:19 -05:00
DeckAdapter: cache field lookups
This commit is contained in:
parent
9a89262714
commit
e3d13a3880
@ -99,8 +99,12 @@ public class DeckAdapter extends BaseAdapter
|
||||
*/
|
||||
public int getPositionByName(String name)
|
||||
{
|
||||
for (int i = 0; i < conversations.size(); i++) {
|
||||
if (conversations.get(i).getName().equalsIgnoreCase(name)) {
|
||||
// Optimization - cache field lookups
|
||||
int mSize = conversations.size();
|
||||
LinkedList<Conversation> mItems = this.conversations;
|
||||
|
||||
for (int i = 0; i < mSize; i++) {
|
||||
if (mItems.get(i).getName().equalsIgnoreCase(name)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user