[Android] Simplify logic
Geoffrey Métais
git at videolan.org
Sat Feb 4 16:19:50 CET 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Sat Feb 4 13:59:08 2017 +0100| [e6aca6813df08e705e2bceefb6b8be327d3e72a5] | committer: Geoffrey Métais
Simplify logic
> https://code.videolan.org/videolan/vlc-android/commit/e6aca6813df08e705e2bceefb6b8be327d3e72a5
---
vlc-android/src/org/videolan/vlc/util/MediaItemDiffCallback.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/util/MediaItemDiffCallback.java b/vlc-android/src/org/videolan/vlc/util/MediaItemDiffCallback.java
index d77c693..852ed9f 100644
--- a/vlc-android/src/org/videolan/vlc/util/MediaItemDiffCallback.java
+++ b/vlc-android/src/org/videolan/vlc/util/MediaItemDiffCallback.java
@@ -9,7 +9,7 @@ import java.util.List;
public class MediaItemDiffCallback extends DiffUtil.Callback {
private static final String TAG = "MediaItemDiffCallback";
- protected MediaLibraryItem[] oldList, newList;
+ private MediaLibraryItem[] oldList, newList;
public MediaItemDiffCallback(List<? extends MediaLibraryItem> oldList, List<? extends MediaLibraryItem> newList) {
this.oldList = oldList.toArray(new MediaLibraryItem[oldList.size()]);
@@ -33,7 +33,7 @@ public class MediaItemDiffCallback extends DiffUtil.Callback {
@Override
public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) {
- return !(oldList[oldItemPosition] != null ^ newList[newItemPosition] !=null) && oldList[oldItemPosition].equals(newList[newItemPosition]);
+ return (oldList[oldItemPosition] == null ) == ( newList[newItemPosition] == null) && oldList[oldItemPosition].equals(newList[newItemPosition]);
}
@Override
More information about the Android
mailing list