File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -2935,15 +2935,9 @@ func sortPackagesByDependencyDepth(packages []*Package) []*Package {
29352935
29362936 // Sort by depth (descending) - packages with more dependencies first
29372937 // This is a stable sort, so packages with equal depth maintain their order
2938- for i := 0 ; i < len (sorted )- 1 ; i ++ {
2939- for j := i + 1 ; j < len (sorted ); j ++ {
2940- depthI := depthCache [sorted [i ].FullName ()]
2941- depthJ := depthCache [sorted [j ].FullName ()]
2942- if depthJ > depthI {
2943- sorted [i ], sorted [j ] = sorted [j ], sorted [i ]
2944- }
2945- }
2946- }
2938+ sort .SliceStable (sorted , func (i , j int ) bool {
2939+ return depthCache [sorted [i ].FullName ()] > depthCache [sorted [j ].FullName ()]
2940+ })
29472941
29482942 // Log the sorted order for debugging
29492943 if len (sorted ) > 0 {
You can’t perform that action at this time.
0 commit comments