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
|
@ -248,7 +248,7 @@ secretKeys cmd = catchDefaultIO M.empty makemap
|
|||
-- If the userid contains a ":" or a few other special
|
||||
-- characters, gpg will hex-escape it. Use decode_c to
|
||||
-- undo.
|
||||
extract ((keyid, decode_c userid):c) Nothing rest
|
||||
extract ((keyid, decodeBS (decode_c (encodeBS userid))):c) Nothing rest
|
||||
extract c (Just keyid) rest@(("sec":_):_) =
|
||||
extract ((keyid, ""):c) Nothing rest
|
||||
extract c (Just keyid) (_:rest) =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue