optimize truncateFilePath
authorJoey Hess <joeyh@joeyh.name>
Wed, 22 Jan 2025 16:34:54 +0000 (12:34 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 22 Jan 2025 17:09:15 +0000 (13:09 -0400)
commitf17ec601c4d138a45bb01ac8614f7df0f821f0d3
tree37248c4fae12f33f1ec8690234b2547751b262cc
parent6211e2af4a6918b561133d7a0593368c16cbd198
optimize truncateFilePath

Often the filepath will be all ascii, or mostly so, and this
optimisation makes a file that has an ascii suffix of sufficient length
be roundtrip converted between String and ByteString only once, rather
than once per character.

Sponsored-by: Graham Spencer
Backend/Utilities.hs
Command/AddUrl.hs
Utility/FileSystemEncoding.hs
Utility/Tmp.hs