mirror of
https://gitea.mayex.net/mayekkuzu/Audinaut.git
synced 2025-02-02 21:23:47 +03:00
Fix redundant addAll
This commit is contained in:
parent
b7b90ea8d5
commit
4fed3bd3a3
@ -315,8 +315,7 @@ public abstract class SectionAdapter<T> extends RecyclerView.Adapter<UpdateViewH
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<T> getSelected() {
|
public List<T> getSelected() {
|
||||||
List<T> selected = new ArrayList<>();
|
List<T> selected = new ArrayList<>(this.selected);
|
||||||
selected.addAll(this.selected);
|
|
||||||
return selected;
|
return selected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,8 +97,7 @@ public class DownloadFragment extends SelectRecyclerFragment<DownloadFile> imple
|
|||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
List<DownloadFile> songList = new ArrayList<>();
|
List<DownloadFile> songList = new ArrayList<>(downloadService.getBackgroundDownloads());
|
||||||
songList.addAll(downloadService.getBackgroundDownloads());
|
|
||||||
currentRevision = downloadService.getDownloadListUpdateRevision();
|
currentRevision = downloadService.getDownloadListUpdateRevision();
|
||||||
return songList;
|
return songList;
|
||||||
}
|
}
|
||||||
|
@ -177,7 +177,6 @@ public class SelectArtistFragment extends SelectRecyclerFragment<Serializable> i
|
|||||||
items.addAll(entries);
|
items.addAll(entries);
|
||||||
} else {
|
} else {
|
||||||
List<Artist> artists = new ArrayList<>();
|
List<Artist> artists = new ArrayList<>();
|
||||||
items = new ArrayList<>();
|
|
||||||
MusicDirectory dir = musicService.getMusicDirectory(groupId, groupName, refresh, context, listener);
|
MusicDirectory dir = musicService.getMusicDirectory(groupId, groupName, refresh, context, listener);
|
||||||
for (Entry entry : dir.getChildren(true, false)) {
|
for (Entry entry : dir.getChildren(true, false)) {
|
||||||
Artist artist = new Artist();
|
Artist artist = new Artist();
|
||||||
@ -189,7 +188,7 @@ public class SelectArtistFragment extends SelectRecyclerFragment<Serializable> i
|
|||||||
Indexes indexes = new Indexes();
|
Indexes indexes = new Indexes();
|
||||||
//indexes.setArtists = artists;
|
//indexes.setArtists = artists;
|
||||||
indexes.sortChildren(context);
|
indexes.sortChildren(context);
|
||||||
items.addAll(indexes.getArtists());
|
items = new ArrayList<>(indexes.getArtists());
|
||||||
|
|
||||||
entries = dir.getChildren(false, true);
|
entries = dir.getChildren(false, true);
|
||||||
items.addAll(entries);
|
items.addAll(entries);
|
||||||
|
@ -836,8 +836,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR
|
|||||||
@Override
|
@Override
|
||||||
protected List<Playlist> doInBackground() throws Throwable {
|
protected List<Playlist> doInBackground() throws Throwable {
|
||||||
MusicService musicService = MusicServiceFactory.getMusicService(context);
|
MusicService musicService = MusicServiceFactory.getMusicService(context);
|
||||||
List<Playlist> playlists = new ArrayList<>();
|
List<Playlist> playlists = new ArrayList<>(musicService.getPlaylists(false, context, this));
|
||||||
playlists.addAll(musicService.getPlaylists(false, context, this));
|
|
||||||
|
|
||||||
// Iterate through and remove all non owned public playlists
|
// Iterate through and remove all non owned public playlists
|
||||||
Iterator<Playlist> it = playlists.iterator();
|
Iterator<Playlist> it = playlists.iterator();
|
||||||
|
@ -659,8 +659,7 @@ public class CachedMusicService implements MusicService {
|
|||||||
|
|
||||||
private void deleteRemovedEntries(Context context, MusicDirectory dir, MusicDirectory cached) {
|
private void deleteRemovedEntries(Context context, MusicDirectory dir, MusicDirectory cached) {
|
||||||
if (cached != null) {
|
if (cached != null) {
|
||||||
List<Entry> oldList = new ArrayList<>();
|
List<Entry> oldList = new ArrayList<>(cached.getChildren());
|
||||||
oldList.addAll(cached.getChildren());
|
|
||||||
oldList.removeAll(dir.getChildren());
|
oldList.removeAll(dir.getChildren());
|
||||||
|
|
||||||
// Anything remaining has been removed from server
|
// Anything remaining has been removed from server
|
||||||
|
Loading…
Reference in New Issue
Block a user