diff options
author | ByteHamster <info@bytehamster.com> | 2020-01-02 18:40:03 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2020-01-02 18:40:05 +0100 |
commit | 7f402168b7d51999dfe73058115e6184ee1ffb90 (patch) | |
tree | 47360bad297ffb7bfd2a2e9dff91f4dd8c5309d9 /app | |
parent | 5fc6877a87ab1da71244336ffd388bf3f0928415 (diff) | |
download | AntennaPod-7f402168b7d51999dfe73058115e6184ee1ffb90.zip |
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.
Diffstat (limited to 'app')
5 files changed, 5 insertions, 7 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java b/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java index 8e16d1a3b..936337cbf 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java @@ -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)); diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java index ff131aeba..100e33e0f 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java @@ -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()); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java index 3949a03a9..8df2c3819 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java @@ -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(); } }; diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/AutoDownloadPreferencesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/AutoDownloadPreferencesFragment.java index fa17fed0a..469697e23 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/AutoDownloadPreferencesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/AutoDownloadPreferencesFragment.java @@ -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; diff --git a/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java index e32deba27..44b6453e5 100644 --- a/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java +++ b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java @@ -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); } }; |