mirror of
https://github.com/joshuaclayton/unused.git
synced 2024-09-11 12:55:54 +03:00
Don't cache an empty list of matches
Why? ==== If a list of matches is empty, there's no reason to cache it.
This commit is contained in:
parent
9bf9499e67
commit
8a294a6acc
@ -16,6 +16,7 @@ cached context f =
|
||||
fromCache = maybe (writeCache =<< liftReaderT f) return =<< readCache
|
||||
|
||||
writeCache :: ToRecord a => [a] -> ReaderT String IO [a]
|
||||
writeCache [] = return []
|
||||
writeCache contents = do
|
||||
liftReaderT $ createDirectoryIfMissing True cacheDirectory
|
||||
fileName <- ask
|
||||
|
Loading…
Reference in New Issue
Block a user