Skip to content

Commit

Permalink
smeller code
Browse files Browse the repository at this point in the history
  • Loading branch information
migueldesarrollosoftware committed Jan 18, 2024
1 parent a923efd commit 871505f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,8 @@ export class DeleteController extends CallbackController {
}

private CleanQueueFolder(folderUuid: Folder['uuid']) {
const folders = this.foldersQueue.values;
const toReversed = folders.reverse();
toReversed.forEach((folder) => {
const reversedFolders = this.foldersQueue.reversedValues;
reversedFolders.forEach((folder) => {
const isParentFolder = this.folderContainerDetector.run(
folder,
folderUuid
Expand Down
4 changes: 4 additions & 0 deletions src/context/virtual-drive/shared/domain/DelayQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ export class DelayQueue {
return Array.from(this.queue.keys());
}

get reversedValues(): string[] {
return Array.from(this.queue.keys()).reverse();
}

get isEmpty(): boolean {
return this.queue.size === 0;
}
Expand Down

0 comments on commit 871505f

Please sign in to comment.