diff options
author | Joey Hess <joeyh@joeyh.name> | 2023-04-09 12:53:13 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2023-04-09 12:53:13 -0400 |
commit | 1c21ce17d44c7d9e5f827f1d02e37e9e51216f1d (patch) | |
tree | 814c666e626f57aafbbed9399e39d0be393ec250 /Git | |
parent | 2ba1559a8e895a4f0bc5b50fac9141b42e1ea2e5 (diff) |
avoid unncessary nested lists for combineing StringContainingQuotedPath
Diffstat (limited to 'Git')
-rw-r--r-- | Git/Filename.hs | 6 |
1 files 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 |