[Android] Fix list updates

Geoffrey Métais git at videolan.org
Tue Jan 16 17:44:55 CET 2018


vlc-android | branch: chromecast | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Dec 20 12:39:41 2017 +0100| [64bf8cdb4373268a5b09a77510ed493b63229d3e] | committer: Geoffrey Métais

Fix list updates

> https://code.videolan.org/videolan/vlc-android/commit/64bf8cdb4373268a5b09a77510ed493b63229d3e
---

 vlc-android/src/org/videolan/vlc/util/Util.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/util/Util.java b/vlc-android/src/org/videolan/vlc/util/Util.java
index 79fe57988..c8badb25b 100644
--- a/vlc-android/src/org/videolan/vlc/util/Util.java
+++ b/vlc-android/src/org/videolan/vlc/util/Util.java
@@ -149,10 +149,11 @@ public class Util {
         List<T> newItems = new ArrayList<>();
         outer:
         for (T newItem : items) {
-            for (T oldItem : dataset) {
+            for (int i = 0; i < dataset.size(); ++i) {
+                T oldItem = dataset.get(i);
                 if (newItem.equals(oldItem)) {
                     //noinspection UnusedAssignment
-                    oldItem = newItem;
+                    dataset.set(i, newItem);
                     continue outer;
                 }
             }



More information about the Android mailing list