Skip to content

Commit

Permalink
Use ordNub instead of nub
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed May 15, 2024
1 parent 30b2b1f commit fa8f6c9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ import Distribution.Simple.Setup
import Distribution.Simple.Utils
( debug
, lowercase
, ordNub
)
import Distribution.Types.CondTree
( CondBranch (..)
Expand Down Expand Up @@ -274,7 +275,7 @@ parseProjectSkeleton cacheDir httpTransport verbosity importsBy projectDir sourc

-- Once we canonicalize the import path, we can check for cyclical and duplicate imports
normLocPath@(ProjectConfigPath (uniqueImport :| _)) <- canonicalizeConfigPath projectDir importLocPath
seenImportsBy@(fmap fst -> seenImports) <- atomicModifyIORef' importsBy (\ibs -> (nub $ (uniqueImport, normLocPath) : ibs, ibs))
seenImportsBy@(fmap fst -> seenImports) <- atomicModifyIORef' importsBy (\ibs -> (ordNub $ (uniqueImport, normLocPath) : ibs, ibs))

debug verbosity $ "\nimport path, normalized\n=======================\n" ++ render (docProjectConfigPath normLocPath)
debug verbosity "\nseen unique paths\n================="
Expand Down

0 comments on commit fa8f6c9

Please sign in to comment.