Skip to content

Commit

Permalink
Remove duplicates and sort dub dependencies
Browse files Browse the repository at this point in the history
Co-authored-by: Jan Jurzitza <[email protected]>
  • Loading branch information
electricface and WebFreak001 committed Apr 18, 2024
1 parent 71b8c27 commit 13f91dd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions workspace-d/source/workspaced/com/dub.d
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,10 @@ string[] listDependencies(scope const Package pkg)
return dependencies;
foreach (dep; deps)
dependencies ~= dep.name;
dependencies.sort();
// filter duplicates in-place using copy.
// copy + this length construct allows us to `uniq` in-place
dependencies.length -= dependencies.uniq().copy(dependencies).length;
return dependencies;
}

Expand Down

0 comments on commit 13f91dd

Please sign in to comment.