From 95b4e13173739e9638cb99a7a725fd92635ff1b3 Mon Sep 17 00:00:00 2001 From: Joshua Clayton Date: Sat, 7 May 2016 14:53:09 -0400 Subject: [PATCH] Remove unnecessary additional filter by matching paths This additional filter can be removed as filtering out matches by matching path already occurs --- src/Unused/DirectoryGrouping.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Unused/DirectoryGrouping.hs b/src/Unused/DirectoryGrouping.hs index 774f227..a9b9fb7 100644 --- a/src/Unused/DirectoryGrouping.hs +++ b/src/Unused/DirectoryGrouping.hs @@ -16,11 +16,9 @@ responsesGroupedByPath pr = responseForPath :: DirectoryPrefix -> TermMatchSet -> TermMatchSet responseForPath s = - filterVByPath . filterKVByPath + filterVByPath where filterVByPath = Map.map (updateMatchesWith newMatches) - filterKVByPath = Map.filterWithKey (const $ \a -> s `elem` allPaths a) - allPaths = fmap (fileNameGrouping . tmPath) . trMatches updateMatchesWith f tr = tr { trMatches = f tr } newMatches = filter ((== s) . fileNameGrouping . tmPath) . trMatches