Skip to content

No need to delete the same key twice #1860

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions ghcide/src/Development/IDE/Core/FileStore.hs
Original file line number Diff line number Diff line change
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