バージョン
3.5-1812
ブランチ
master
投稿日時
10 年, 8 ヶ月前
Windows x64 Windows x86 Mac OS X
コミット
07d729daa2d95d9812a7ea33c193c62cd1f8019b
投稿者
Lioncash
変更点
[Android] Prevent duplicate duplicate items from being in the game list at one time.

Previously it was possible for a game with the same path and name to be in the list as another. This is annoying because duplicates ae (obviously) no different from the initial item.

This prevents duplicates from entering the list.

The way this works is:

1. We get the final list of items to add to the list.

2. Loop through it using two indices, which, for this explanation I'll call [item] and [itemAfter]

We compare path name at item with index [item] and the path name at item with index [itemAfter]
To phrase this numerically comparison works like so:

for (int i = 0; i < listSize; i++)
{
    if (i+1 < listSize)
        item[i].getPath().equals(item[i+1].getPath())
}

3. For each path comparison that is true, remove item at [indexNext].