Remove unnecessary additional filter by matching paths

This additional filter can be removed as filtering out matches by
matching path already occurs
This commit is contained in:
Joshua Clayton 2016-05-07 14:53:09 -04:00
parent bfca8cae19
commit 95b4e13173

View File

@ -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