Skip to content

Commit

Permalink
pull APs out of the loop
Browse files Browse the repository at this point in the history
  • Loading branch information
baronfel committed Apr 24, 2020
1 parent d090f8b commit 8cf804a
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/Paket.Core/PublicAPI.fs
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,23 @@ type Dependencies(dependenciesFileName: string) =
| None -> versionRequirement
)

let (|IndirectDependency|DirectDependency|UnknownDependency|) (p: PackageName) =
if not (known.Contains p)
then UnknownDependency
else
if directDeps.Contains p
then DirectDependency
else IndirectDependency

let (|MatchesRange|NeedsRangeUpdate|LockRangeNotFound|) (packageName: PackageName, nuspecVersionRequirement: VersionRequirement) =

match lockedPackageVersionRequirements.TryFind packageName with
| Some lockedFileRange ->
if lockedFileRange = nuspecVersionRequirement
then MatchesRange
else NeedsRangeUpdate lockedFileRange
| None -> LockRangeNotFound

for nuspecFile in nuspecFileList do
let nuspecText = File.ReadAllText nuspecFile

Expand All @@ -919,23 +936,6 @@ type Dependencies(dependenciesFileName: string) =
let rec traverse (parent:XmlNode) =
let nodesToRemove = ResizeArray()

let (|IndirectDependency|DirectDependency|UnknownDependency|) (p: PackageName) =
if not (known.Contains p)
then UnknownDependency
else
if directDeps.Contains p
then DirectDependency
else IndirectDependency

let (|MatchesRange|NeedsRangeUpdate|LockRangeNotFound|) (packageName: PackageName, nuspecVersionRequirement: VersionRequirement) =

match lockedPackageVersionRequirements.TryFind packageName with
| Some lockedFileRange ->
if lockedFileRange = nuspecVersionRequirement
then MatchesRange
else NeedsRangeUpdate lockedFileRange
| None -> LockRangeNotFound

for node in parent.ChildNodes do
if node.Name = "dependency" then
let packName = attr "id" node |> Option.map PackageName
Expand Down

0 comments on commit 8cf804a

Please sign in to comment.