Merge pull request #3720 from ByteHamster/do-not-allocate-arrays
Do not allocate space for arrays that do not need to be allocated
This commit is contained in:
commit
6d0b16461d
|
@ -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());
|
||||
|
|
|
@ -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…
Reference in New Issue