parsePOSIXTime ByteString conversion

Some easy (though tiny) speed wins.

Sponsored-by: Luke T. Shumaker on Patreon
This commit is contained in:
Joey Hess 2025-01-22 16:41:06 -04:00
parent d3de3c28eb
commit 77e9781ae2
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
13 changed files with 22 additions and 16 deletions

View file

@ -320,7 +320,7 @@ readTransferInfo mpid s = TransferInfo
bits = splitc ' ' firstline
numbits = length bits
time = if numbits > 0
then Just <$> parsePOSIXTime =<< headMaybe bits
then Just <$> parsePOSIXTime . encodeBS =<< headMaybe bits
else pure Nothing -- not failure
bytes = if numbits > 1
then Just <$> readish =<< headMaybe (drop 1 bits)