marginally faster VectorClock Builder

show of a POSIXTime is 7-bit ascii, so no need to use the filesystem
encoding on it
This commit is contained in:
Joey Hess 2019-01-09 14:17:00 -04:00
parent 232b1a08f3
commit 1928b82867
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -18,7 +18,6 @@ import Prelude
import Utility.Env
import Utility.TimeStamp
import Utility.QuickCheck
import Utility.FileSystemEncoding
import qualified Data.Attoparsec.ByteString.Lazy as A
-- | Some very old logs did not have any time stamp at all;
@ -46,7 +45,7 @@ formatVectorClock Unknown = "0"
formatVectorClock (VectorClock t) = show t
buildVectorClock :: VectorClock -> Builder
buildVectorClock = byteString . encodeBS' . formatVectorClock
buildVectorClock = string7 . formatVectorClock
parseVectorClock :: String -> Maybe VectorClock
parseVectorClock t = VectorClock <$> parsePOSIXTime t