Skip to content

Commit f686858

Browse files
Fix performance issue in 'allDependencies' (#668)
1 parent 75a83b6 commit f686858

File tree

7 files changed

+2937
-605
lines changed

7 files changed

+2937
-605
lines changed

app/src/App/API.purs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -625,10 +625,7 @@ publish source payload = do
625625
let sourceModules = Map.keys $ Map.filter (isJust <<< String.stripPrefix (String.Pattern packageDirectory) <<< _.path) graph
626626

627627
Log.debug "Found all modules used in package source. Finding all modules used by those modules..."
628-
-- We find all dependencies of each module used in the source,
629-
-- which results in a set containing every module name reachable
630-
-- by the source code.
631-
let allReachableModules = Set.fromFoldable $ Array.fold $ Array.mapMaybe (flip PursGraph.allDependencies graph) $ Set.toUnfoldable sourceModules
628+
let allReachableModules = PursGraph.allDependenciesOf sourceModules graph
632629

633630
-- Then we can associate each reachable module with its package
634631
-- name to get the full set of used package names.

app/src/App/Legacy/Manifest.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fetchLegacyManifest
7676
fetchLegacyManifest name address ref = Run.Except.runExceptAt _legacyManifestError do
7777
legacyPackageSets <- fetchLegacyPackageSets >>= case _ of
7878
Left error -> do
79-
Log.error $ "Failed error when to fetch legacy package sets: " <> Octokit.printGitHubError error
79+
Log.error $ "Failed to fetch legacy package sets: " <> Octokit.printGitHubError error
8080
Except.throw "Could not retrieve legacy package sets; aborting to avoid producing incorrect legacy manifest depedency bounds."
8181
Right union -> pure union
8282

0 commit comments

Comments
 (0)