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)
|
public int getPositionByName(String name)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < conversations.size(); i++) {
|
// Optimization - cache field lookups
|
||||||
if (conversations.get(i).getName().equalsIgnoreCase(name)) {
|
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;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user