convert all per-uuid log files to use Builder
Mostly didn't push the ByteStrings down very deep, but all of these log files are not written to frequently at all, so slight remaining innefficiency doesn't matter. In Logs.UUID, removed the fixBadUUID code that cleaned up after a bug in git-annex versions 3.20111105-3.20111110. In the unlikely event that a repo was last touched by that ancient git-annex version, the descriptions of remotes would appear missing when used with this version of git-annex. That is such minor breakage, and so unlikely to still be a problem for any repos, that it was not worth forward-porting that code to ByteString.
This commit is contained in:
parent
de4980ef85
commit
2fef43dd71
16 changed files with 70 additions and 54 deletions
|
@ -14,6 +14,7 @@ import qualified Data.Map as M
|
|||
import qualified Data.UUID as U
|
||||
import Data.Maybe
|
||||
import Data.String
|
||||
import Data.ByteString.Builder
|
||||
|
||||
import Utility.FileSystemEncoding
|
||||
import qualified Utility.SimpleProtocol as Proto
|
||||
|
@ -54,6 +55,9 @@ instance ToUUID String where
|
|||
instance ToUUID U.UUID where
|
||||
toUUID = toUUID . U.toASCIIBytes
|
||||
|
||||
buildUUID :: UUID -> Builder
|
||||
buildUUID (UUID b) = byteString b
|
||||
|
||||
isUUID :: String -> Bool
|
||||
isUUID = isJust . U.fromString
|
||||
|
||||
|
@ -67,6 +71,9 @@ fromUUIDDesc (UUIDDesc d) = decodeBS d
|
|||
toUUIDDesc :: String -> UUIDDesc
|
||||
toUUIDDesc = UUIDDesc . encodeBS
|
||||
|
||||
buildUUIDDesc :: UUIDDesc -> Builder
|
||||
buildUUIDDesc (UUIDDesc b) = byteString b
|
||||
|
||||
type UUIDDescMap = M.Map UUID UUIDDesc
|
||||
|
||||
instance Proto.Serializable UUID where
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue