Skip to content

Commit

Permalink
BXC-4771 simplify loop (#1836)
Browse files Browse the repository at this point in the history
  • Loading branch information
sharonluong authored Nov 19, 2024
1 parent 00066d1 commit 5c7ac30
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ private void zipFiles(WorkObject workObject, AccessGroupSet agentPrincipals, Pat

Map<String, Integer> 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)) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 5c7ac30

Please sign in to comment.