Skip to content

Commit

Permalink
No need to delete twice (#1860)
Browse files Browse the repository at this point in the history
  • Loading branch information
pepeiborra committed May 23, 2021
1 parent 53747d1 commit 00bbcb1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ghcide/src/Development/IDE/Core/FileStore.hs
Expand Up @@ -158,8 +158,7 @@ isInterface f = takeExtension (fromNormalizedFilePath f) `elem` [".hi", ".hi-boo
-- | Reset the GetModificationTime state of interface files
resetInterfaceStore :: ShakeExtras -> NormalizedFilePath -> IO ()
resetInterfaceStore state f = do
deleteValue state (GetModificationTime_ True) f
deleteValue state (GetModificationTime_ False) f
deleteValue state GetModificationTime f

-- | Reset the GetModificationTime state of watched files
resetFileStore :: IdeState -> [FileEvent] -> IO ()
Expand All @@ -174,8 +173,7 @@ resetFileStore ideState changes = mask $ \_ ->
OfInterestVar foisVar <- getIdeGlobalExtras (shakeExtras ideState)
fois <- readVar foisVar
unless (HM.member (toNormalizedFilePath f) fois) $ do
deleteValue (shakeExtras ideState) (GetModificationTime_ True) (toNormalizedFilePath' f)
deleteValue (shakeExtras ideState) (GetModificationTime_ False) (toNormalizedFilePath' f)
deleteValue (shakeExtras ideState) GetModificationTime (toNormalizedFilePath' f)
_ -> pure ()

-- Dir.getModificationTime is surprisingly slow since it performs
Expand Down

0 comments on commit 00bbcb1

Please sign in to comment.