diff options
author | Joey Hess <joeyh@joeyh.name> | 2019-12-18 16:45:03 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2019-12-18 17:10:28 -0400 |
commit | 686791c4ed948db37eee2bdc8dbcca5f539c1b1a (patch) | |
tree | 40605c83ebcbd1a36cdb6d1f22fc960f068a3314 /Logs.hs | |
parent | 9e9def2dc0a0b84a2f98805fd1c170fdc486cf16 (diff) |
more RawFilePath
Remove dup definitions and just use the RawFilePath one. </> etc are
enough faster that it's probably faster than building a String directly,
although I have not benchmarked.
Diffstat (limited to 'Logs.hs')
-rw-r--r-- | Logs.hs | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -119,18 +119,18 @@ exportLog = "export.log" {- The pathname of the location log file for a given key. -} locationLogFile :: GitConfig -> Key -> RawFilePath locationLogFile config key = - branchHashDir config key P.</> keyFile' key <> ".log" + branchHashDir config key P.</> keyFile key <> ".log" {- The filename of the url log for a given key. -} urlLogFile :: GitConfig -> Key -> RawFilePath urlLogFile config key = - branchHashDir config key P.</> keyFile' key <> urlLogExt + branchHashDir config key P.</> keyFile key <> urlLogExt {- Old versions stored the urls elsewhere. -} oldurlLogs :: GitConfig -> Key -> [RawFilePath] oldurlLogs config key = [ "remote/web" P.</> hdir P.</> serializeKey' key <> ".log" - , "remote/web" P.</> hdir P.</> keyFile' key <> ".log" + , "remote/web" P.</> hdir P.</> keyFile key <> ".log" ] where hdir = branchHashDir config key @@ -145,7 +145,7 @@ isUrlLog file = urlLogExt `S.isSuffixOf` file {- The filename of the remote state log for a given key. -} remoteStateLogFile :: GitConfig -> Key -> RawFilePath remoteStateLogFile config key = - (branchHashDir config key P.</> keyFile' key) + (branchHashDir config key P.</> keyFile key) <> remoteStateLogExt remoteStateLogExt :: S.ByteString @@ -157,7 +157,7 @@ isRemoteStateLog path = remoteStateLogExt `S.isSuffixOf` path {- The filename of the chunk log for a given key. -} chunkLogFile :: GitConfig -> Key -> RawFilePath chunkLogFile config key = - (branchHashDir config key P.</> keyFile' key) + (branchHashDir config key P.</> keyFile key) <> chunkLogExt chunkLogExt :: S.ByteString @@ -169,7 +169,7 @@ isChunkLog path = chunkLogExt `S.isSuffixOf` path {- The filename of the metadata log for a given key. -} metaDataLogFile :: GitConfig -> Key -> RawFilePath metaDataLogFile config key = - (branchHashDir config key P.</> keyFile' key) + (branchHashDir config key P.</> keyFile key) <> metaDataLogExt metaDataLogExt :: S.ByteString @@ -181,7 +181,7 @@ isMetaDataLog path = metaDataLogExt `S.isSuffixOf` path {- The filename of the remote metadata log for a given key. -} remoteMetaDataLogFile :: GitConfig -> Key -> RawFilePath remoteMetaDataLogFile config key = - (branchHashDir config key P.</> keyFile' key) + (branchHashDir config key P.</> keyFile key) <> remoteMetaDataLogExt remoteMetaDataLogExt :: S.ByteString @@ -193,7 +193,7 @@ isRemoteMetaDataLog path = remoteMetaDataLogExt `S.isSuffixOf` path {- The filename of the remote content identifier log for a given key. -} remoteContentIdentifierLogFile :: GitConfig -> Key -> RawFilePath remoteContentIdentifierLogFile config key = - (branchHashDir config key P.</> keyFile' key) + (branchHashDir config key P.</> keyFile key) <> remoteContentIdentifierExt remoteContentIdentifierExt :: S.ByteString @@ -205,7 +205,7 @@ isRemoteContentIdentifierLog path = remoteContentIdentifierExt `S.isSuffixOf` pa {- From an extension and a log filename, get the key that it's a log for. -} extLogFileKey :: S.ByteString -> RawFilePath -> Maybe Key extLogFileKey expectedext path - | encodeBS' ext == expectedext = fileKey base + | encodeBS' ext == expectedext = fileKey (toRawFilePath base) | otherwise = Nothing where file = takeFileName (fromRawFilePath path) |