mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2025-01-30 02:14:51 +01:00
Do not allocate space for arrays that do not need to be allocated
Those arrays are just there for the type system. Creating them with a big size is not necessary and uses unnecessary resources.
This commit is contained in:
parent
5fc6877a87
commit
7f402168b7
@ -201,7 +201,7 @@ public class UITestUtils {
|
||||
|
||||
PodDBAdapter adapter = PodDBAdapter.getInstance();
|
||||
adapter.open();
|
||||
adapter.setCompleteFeed(hostedFeeds.toArray(new Feed[hostedFeeds.size()]));
|
||||
adapter.setCompleteFeed(hostedFeeds.toArray(new Feed[0]));
|
||||
adapter.setQueue(queue);
|
||||
adapter.close();
|
||||
EventBus.getDefault().post(new FeedListUpdateEvent(hostedFeeds));
|
||||
|
@ -485,7 +485,7 @@ public class EpisodesApplyActionFragment extends Fragment {
|
||||
}
|
||||
}
|
||||
try {
|
||||
DownloadRequester.getInstance().downloadMedia(getActivity(), toDownload.toArray(new FeedItem[toDownload.size()]));
|
||||
DownloadRequester.getInstance().downloadMedia(getActivity(), toDownload.toArray(new FeedItem[0]));
|
||||
} catch (DownloadRequestException e) {
|
||||
e.printStackTrace();
|
||||
DownloadRequestErrorDialogCreator.newRequestErrorDialog(getActivity(), e.getMessage());
|
||||
|
@ -146,7 +146,7 @@ public class AllEpisodesFragment extends EpisodesListFragment {
|
||||
FilterDialog filterDialog = new FilterDialog(getContext(), feedItemFilter) {
|
||||
@Override
|
||||
protected void updateFilter(Set<String> filterValues) {
|
||||
feedItemFilter = new FeedItemFilter(filterValues.toArray(new String[filterValues.size()]));
|
||||
feedItemFilter = new FeedItemFilter(filterValues.toArray(new String[0]));
|
||||
loadItems();
|
||||
}
|
||||
};
|
||||
|
@ -131,9 +131,7 @@ public class AutoDownloadPreferencesFragment extends PreferenceFragmentCompat {
|
||||
prefValuesList.add(key);
|
||||
}
|
||||
|
||||
UserPreferences.setAutodownloadSelectedNetworks(
|
||||
prefValuesList.toArray(new String[prefValuesList.size()])
|
||||
);
|
||||
UserPreferences.setAutodownloadSelectedNetworks(prefValuesList.toArray(new String[0]));
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -108,7 +108,7 @@ public class FeedMenuHandler {
|
||||
FilterDialog filterDialog = new FilterDialog(context, selectedFeed.getItemFilter()) {
|
||||
@Override
|
||||
protected void updateFilter(Set<String> filterValues) {
|
||||
selectedFeed.setItemFilter(filterValues.toArray(new String[filterValues.size()]));
|
||||
selectedFeed.setItemFilter(filterValues.toArray(new String[0]));
|
||||
DBWriter.setFeedItemsFilter(selectedFeed.getId(), filterValues);
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user