diff --git a/app/src/main/java/com/nextcloud/talk/components/filebrowser/webdav/DavUtils.java b/app/src/main/java/com/nextcloud/talk/components/filebrowser/webdav/DavUtils.java index 2b96ee1db..8bf10c5f2 100644 --- a/app/src/main/java/com/nextcloud/talk/components/filebrowser/webdav/DavUtils.java +++ b/app/src/main/java/com/nextcloud/talk/components/filebrowser/webdav/DavUtils.java @@ -74,7 +74,7 @@ public class DavUtils { public static final String PROPERTY_QUOTA_AVAILABLE_BYTES = "quota-available-bytes"; static Property.Name[] getAllPropSet() { - List props = new ArrayList<>(); + List props = new ArrayList<>(20); props.add(DisplayName.NAME); props.add(GetContentType.NAME); diff --git a/app/src/main/java/com/nextcloud/talk/components/filebrowser/webdav/ReadFilesystemOperation.java b/app/src/main/java/com/nextcloud/talk/components/filebrowser/webdav/ReadFilesystemOperation.java index 31b08d1ec..b8cb247c0 100644 --- a/app/src/main/java/com/nextcloud/talk/components/filebrowser/webdav/ReadFilesystemOperation.java +++ b/app/src/main/java/com/nextcloud/talk/components/filebrowser/webdav/ReadFilesystemOperation.java @@ -69,7 +69,6 @@ public class ReadFilesystemOperation { DavResponse davResponse = new DavResponse(); final List memberElements = new ArrayList<>(); final Response[] rootElement = new Response[1]; - final List remoteFiles = new ArrayList<>(); try { new DavResource(okHttpClient, HttpUrl.parse(url)).propfind(depth, DavUtils.getAllPropSet(), @@ -94,6 +93,7 @@ public class ReadFilesystemOperation { Log.w(TAG, "Error reading remote path"); } + final List remoteFiles = new ArrayList<>(1 + memberElements.size()); remoteFiles.add(BrowserFile.Companion.getModelFromResponse(rootElement[0], rootElement[0].getHref().toString().substring(basePath.length()))); for (Response memberElement : memberElements) { diff --git a/app/src/main/java/com/nextcloud/talk/presenters/MentionAutocompletePresenter.java b/app/src/main/java/com/nextcloud/talk/presenters/MentionAutocompletePresenter.java index f6a28dab8..8aa553714 100644 --- a/app/src/main/java/com/nextcloud/talk/presenters/MentionAutocompletePresenter.java +++ b/app/src/main/java/com/nextcloud/talk/presenters/MentionAutocompletePresenter.java @@ -147,7 +147,8 @@ public class MentionAutocompletePresenter extends RecyclerViewPresenter if (mentionsList.size() == 0) { adapter.clear(); } else { - List internalAbstractFlexibleItemList = new ArrayList<>(); + List internalAbstractFlexibleItemList = + new ArrayList<>(mentionsList.size()); for (Mention mention : mentionsList) { internalAbstractFlexibleItemList.add( new MentionAutocompleteItem(