decode_c converted to ByteString
This speeds up a few things, notably CmdLine.Seek using Git.Filename which uses decode_c and this avoids a conversion to String and back, and probably the ByteString implementation of decode_c is also faster for simple cases at least than the string version. encode_c cannot be converted to ByteString (or if it did, it would have to convert right back to String in order to handle unicode). Sponsored-by: Brock Spratlen on Patreon
This commit is contained in:
parent
f0b1034f8f
commit
371d4f8183
4 changed files with 57 additions and 36 deletions
|
@ -26,8 +26,7 @@ decode b = case S.uncons b of
|
|||
Nothing -> b
|
||||
Just (i, l)
|
||||
| l /= q -> b
|
||||
| otherwise ->
|
||||
encodeBS $ decode_c $ decodeBS i
|
||||
| otherwise -> decode_c i
|
||||
where
|
||||
q :: Word8
|
||||
q = fromIntegral (ord '"')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue