From 1c21ce17d44c7d9e5f827f1d02e37e9e51216f1d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 9 Apr 2023 12:53:13 -0400 Subject: [PATCH] avoid unncessary nested lists for combineing StringContainingQuotedPath --- Git/Filename.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Git/Filename.hs b/Git/Filename.hs index 08b1d6359f..ad11428c41 100644 --- a/Git/Filename.hs +++ b/Git/Filename.hs @@ -70,20 +70,20 @@ instance Quoteable RawFilePath where data StringContainingQuotedPath = UnquotedString String | QuotedPath RawFilePath - | StringContainingQuotedPathMulti [StringContainingQuotedPath] + | StringContainingQuotedPath :+: StringContainingQuotedPath deriving (Show, Eq) instance Quoteable StringContainingQuotedPath where quote _ (UnquotedString s) = encodeBS s quote qp (QuotedPath p) = quote qp p - quote qp (StringContainingQuotedPathMulti l) = S.concat (map (quote qp) l) + quote qp (a :+: b) = quote qp a <> quote qp b instance IsString StringContainingQuotedPath where fromString = UnquotedString instance Sem.Semigroup StringContainingQuotedPath where UnquotedString a <> UnquotedString b = UnquotedString (a <> b) - a <> b = StringContainingQuotedPathMulti [a, b] + a <> b = a :+: b instance Monoid StringContainingQuotedPath where mempty = UnquotedString mempty