From 5c7ac30d3b01acc582ba9e4a3edda5a7926fd4c1 Mon Sep 17 00:00:00 2001 From: sharonl <6546457+sharonluong@users.noreply.github.com> Date: Tue, 19 Nov 2024 14:44:26 -0500 Subject: [PATCH] BXC-4771 simplify loop (#1836) --- .../boxc/operations/impl/download/DownloadBulkService.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/operations/src/main/java/edu/unc/lib/boxc/operations/impl/download/DownloadBulkService.java b/operations/src/main/java/edu/unc/lib/boxc/operations/impl/download/DownloadBulkService.java index e19ea83332..6ca2491eb1 100644 --- a/operations/src/main/java/edu/unc/lib/boxc/operations/impl/download/DownloadBulkService.java +++ b/operations/src/main/java/edu/unc/lib/boxc/operations/impl/download/DownloadBulkService.java @@ -62,9 +62,8 @@ private void zipFiles(WorkObject workObject, AccessGroupSet agentPrincipals, Pat Map duplicates = new HashMap<>(); int count = 0; - var loopLimit = getLoopLimit(memberObjects.size()); for (ContentObject memberObject : memberObjects ) { - if (count == loopLimit) { + if (count == fileLimit) { break; } if (!(memberObject instanceof FileObject)) { @@ -108,9 +107,6 @@ private String formatFilename(String filename, int copyNumber) { var base = FilenameUtils.removeExtension(filename); return base + "(" + copyNumber + ")." + extension; } - private int getLoopLimit(int arraySize) { - return Math.min(fileLimit, arraySize); - } public void setAclService(AccessControlService aclService) { this.aclService = aclService;