Skip to content

Commit

Permalink
Update workspace-d/source/workspaced/com/dub.d
Browse files Browse the repository at this point in the history
Co-authored-by: Jan Jurzitza <[email protected]>
  • Loading branch information
electricface and WebFreak001 authored Apr 18, 2024
1 parent dd51426 commit 428eecc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion workspace-d/source/workspaced/com/dub.d
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,9 @@ string[] listDependencies(scope const Package pkg)
foreach (dep; deps)
dependencies ~= dep.name;
// Filter duplicates in-place using copy
dependencies.length -= dependencies.sort.uniq().copy(dependencies).length;
dependencies.sort();
// 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 428eecc

Please sign in to comment.