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