diff --git a/src/Paket.Core/PaketConfigFiles/LockFile.fs b/src/Paket.Core/PaketConfigFiles/LockFile.fs index 91006224e4..6616cc2bed 100644 --- a/src/Paket.Core/PaketConfigFiles/LockFile.fs +++ b/src/Paket.Core/PaketConfigFiles/LockFile.fs @@ -884,7 +884,7 @@ type LockFile (fileName:string, groups: Map) = member this.GetOrderedPackageHull(groupName,referencesFile:ReferencesFile,targetProfileOpt) = let usedPackageKeys = HashSet<_>() - let toVisit = ref Set.empty + let toVisit = ref [] let cliTools = ref Set.empty let resolution = match this.Groups |> Map.tryFind groupName with @@ -920,15 +920,14 @@ type LockFile (fileName:string, groups: Map) = usedPackageKeys.Add k |> ignore let deps = this.GetDirectDependenciesOfSafe(groupName,p.Name,referencesFile.FileName) - - toVisit := Set.add (k,p,deps) !toVisit + toVisit := List.append toVisit.contents [(k,p,deps)] | None -> () let visited = Dictionary<_,_>() - while !toVisit <> Set.empty do - let current = Set.minElement !toVisit - toVisit := Set.remove current !toVisit + while !toVisit <> List.empty do + let current = toVisit.Value[0] + toVisit := toVisit.Value.Tail let visitKey,p,deps = current if visited.ContainsKey(visitKey) then () @@ -937,9 +936,9 @@ type LockFile (fileName:string, groups: Map) = let groupName,_packageName = visitKey for dep in deps do - let deps = this.GetDirectDependenciesOfSafe(groupName,dep,referencesFile.FileName) + let deps2 = this.GetDirectDependenciesOfSafe(groupName,dep,referencesFile.FileName) let packagageSettings = { p with Settings = { p.Settings with Aliases = Map.empty }} - toVisit := Set.add ((groupName,dep),packagageSettings,deps) !toVisit + toVisit := List.append toVisit.contents [((groupName,dep),packagageSettings,deps2)] let emitted = HashSet<_>() [while visited.Count > 0 do