Skip to content

Commit f09c388

Browse files
committed
getLocatedImportsRule: "Simplify" some bogus logic
1 parent 39519d6 commit f09c388

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

ghcide/src/Development/IDE/Core/Rules.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,7 @@ getLocatedImportsRule recorder =
328328
return $ if itExists then Just nfp' else Nothing
329329
| Just tt <- HM.lookup (TargetModule modName) targets = do
330330
-- reuse the existing NormalizedFilePath in order to maximize sharing
331-
let ttmap = HM.mapWithKey const (HashSet.toMap tt)
332-
nfp' = HM.lookupDefault nfp nfp ttmap
331+
let nfp' = nfp
333332
itExists <- getFileExists nfp'
334333
return $ if itExists then Just nfp' else Nothing
335334
| otherwise = do

ghcide/src/Development/IDE/Types/KnownTargets.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import GHC.Generics
2121
-- | A mapping of module name to known files
2222
data KnownTargets = KnownTargets
2323
{ targetMap :: !(HashMap Target (HashSet NormalizedFilePath))
24-
-- | 'normalisingMap' is a cached copy of `HMap.mapKey const targetMap`
24+
-- | 'normalisingMap' is a cached copy of `HMap.mapWithKey const targetMap`
2525
--
2626
-- At startup 'GetLocatedImports' is called on all known files. Say you have 10000
2727
-- modules in your project then this leads to 10000 calls to 'GetLocatedImports'

0 commit comments

Comments
 (0)