convert getFileSize to RawFilePath
Lots of nice wins from this in avoiding unncessary work, and I think nothing got slower. This commit was sponsored by Boyd Stephen Smith Jr. on Patreon.
This commit is contained in:
parent
2670af9d5a
commit
9b0dde834e
34 changed files with 79 additions and 70 deletions
|
@ -186,15 +186,15 @@ readInodeCache s = case words s of
|
|||
|
||||
genInodeCache :: RawFilePath -> TSDelta -> IO (Maybe InodeCache)
|
||||
genInodeCache f delta = catchDefaultIO Nothing $
|
||||
toInodeCache delta (fromRawFilePath f) =<< R.getFileStatus f
|
||||
toInodeCache delta f =<< R.getFileStatus f
|
||||
|
||||
toInodeCache :: TSDelta -> FilePath -> FileStatus -> IO (Maybe InodeCache)
|
||||
toInodeCache :: TSDelta -> RawFilePath -> FileStatus -> IO (Maybe InodeCache)
|
||||
toInodeCache (TSDelta getdelta) f s
|
||||
| isRegularFile s = do
|
||||
delta <- getdelta
|
||||
sz <- getFileSize' f s
|
||||
#ifdef mingw32_HOST_OS
|
||||
mtime <- utcTimeToPOSIXSeconds <$> getModificationTime f
|
||||
mtime <- utcTimeToPOSIXSeconds <$> getModificationTime (fromRawFilePath f)
|
||||
#else
|
||||
let mtime = modificationTimeHiRes s
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue