From 4a5f18a8ecfda4220a6963acd21025d783caf071 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 11 Apr 2023 15:29:04 -0400 Subject: [PATCH] IsString StringContainingQuotedPath optimisation This causes an encodeBS thunk, and the first evaluation of the string forces it. From then on, further uses operate on a ByteString. This avoids converting repeatedly. --- Git/Filename.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Git/Filename.hs b/Git/Filename.hs index 2e86e9efff..2baea62dc6 100644 --- a/Git/Filename.hs +++ b/Git/Filename.hs @@ -99,7 +99,7 @@ instance Quoteable StringContainingQuotedPath where noquote (a :+: b) = noquote a <> noquote b instance IsString StringContainingQuotedPath where - fromString = UnquotedString + fromString = UnquotedByteString . encodeBS instance Sem.Semigroup StringContainingQuotedPath where UnquotedString a <> UnquotedString b = UnquotedString (a <> b)