Skip to content

Commit

Permalink
performance: don't recalculate array on each iteration in fuseConflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
0x53A committed Apr 30, 2017
1 parent f5deb48 commit 505c58c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Paket.Core/Dependencies/PackageResolver.fs
Original file line number Diff line number Diff line change
Expand Up @@ -653,14 +653,15 @@ let Resolve (getVersionsF, getPackageDetailsF, groupName:GroupName, globalStrate

let inline fuseConflicts currentConflict priorConflictSteps conflicts =
let findMatchingStep priorConflictSteps =
let currentNames =
conflicts
|> Seq.collect (fun c ->
let graphNameList =
c.Graph |> List.map (fun (pr:PackageRequirement) -> pr.Name)
c.Name :: graphNameList)
|> Seq.toArray
priorConflictSteps
|> List.tryExtractOne (fun (_,_,lastRequirement:PackageRequirement,_,_) ->
let currentNames =
conflicts |> Seq.collect (fun c ->
let graphNameList =
c.Graph |> List.map (fun (pr:PackageRequirement) -> pr.Name)
c.Name :: graphNameList)
|> Seq.toArray
currentNames |> Array.contains lastRequirement.Name)

match findMatchingStep priorConflictSteps with
Expand Down

0 comments on commit 505c58c

Please sign in to comment.